mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-02 21:00:16 -05:00
More coverage test
This commit is contained in:
parent
748c086edb
commit
21561e6cf9
10 changed files with 88 additions and 4 deletions
|
|
@ -101,10 +101,12 @@ void test(int argc, char* argv[])
|
|||
int i;
|
||||
char buffer[ESC_MAX];
|
||||
|
||||
/* special testing code for quoting */
|
||||
/* special testing code */
|
||||
if (argc < 2 || strcmp(argv[1], "test") != 0)
|
||||
return;
|
||||
|
||||
lock_init();
|
||||
|
||||
assert(strcmp(strpolish(strcpy(buffer, "\r \n\xFF")), " ") == 0);
|
||||
assert(strcmp(strtrim(strcpy(buffer, " trim trim \n\r")), "trim trim") == 0);
|
||||
assert(strcmp(strlwr(strcpy(buffer, " LoWer\n\r")), " lower\n\r") == 0);
|
||||
|
|
@ -486,8 +488,14 @@ void test(int argc, char* argv[])
|
|||
assert(strcmp(esc_shell("test_2024-01-01.log", buffer), "test_2024-01-01.log") == 0);
|
||||
#endif
|
||||
|
||||
random_seed(0);
|
||||
assert(random_u8() == 0xAF);
|
||||
assert(random_u64() == 0x6E789E6AA1B965F4ULL);
|
||||
|
||||
printf("Everything OK\n");
|
||||
|
||||
lock_done();
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue