mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-04 05:40:14 -05:00
Eliminate obsolete raid_zero API and dedicated zero buffers
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
This commit is contained in:
parent
8f27c393d6
commit
0b64fb2eae
7 changed files with 66 additions and 68 deletions
|
|
@ -2038,6 +2038,26 @@ static void test_misc(int argc, char* argv[])
|
|||
assert(strcmp(esc_tag(""), "") == 0);
|
||||
assert(strcmp(esc_tag("\n\r:\\\\"), "\\n\\r\\d\\\\\\\\") == 0);
|
||||
|
||||
{
|
||||
unsigned char zbuf[64];
|
||||
unsigned zi, zj;
|
||||
|
||||
memset(zbuf, 0, sizeof(zbuf));
|
||||
assert(mem_is_zero(zbuf, 0) != 0);
|
||||
|
||||
for (zi = 0; zi < sizeof(zbuf); ++zi) {
|
||||
for (zj = zi; zj <= sizeof(zbuf); ++zj) {
|
||||
assert(mem_is_zero(zbuf + zi, zj - zi) != 0);
|
||||
}
|
||||
}
|
||||
|
||||
for (zi = 0; zi < sizeof(zbuf); ++zi) {
|
||||
zbuf[zi] = 1;
|
||||
assert(mem_is_zero(zbuf, sizeof(zbuf)) == 0);
|
||||
zbuf[zi] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 2; i < argc; ++i) {
|
||||
printf("argv[%d]\n", i);
|
||||
printf("\t#%s#\n", argv[i]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue