More coverage test
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-win (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:
Andrea Mazzoleni 2026-02-28 10:08:09 +01:00
parent 748c086edb
commit 21561e6cf9
10 changed files with 88 additions and 4 deletions

View file

@ -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);
}