unit test api needs to be rewritten. crazy to assert functions with heap allocated memory or "in place"
manipulation.
This commit is contained in:
parent
64b6356e61
commit
9fa5c9eac9
5 changed files with 14 additions and 13 deletions
10
test/unit.c
10
test/unit.c
|
|
@ -14,6 +14,16 @@ static inline char ranchr() {
|
|||
return ch;
|
||||
}
|
||||
|
||||
void __assert_str(char *file, int line, char *func, char *a, char *b) {
|
||||
|
||||
if (a == NULL || b == NULL)
|
||||
__uexit(file, line, func, "a or b is null\n", NULL);
|
||||
|
||||
if (strcmp(a, b) != 0)
|
||||
__uexit(file, line, func, "\"%s\" != \"%s\"\n", a, b);
|
||||
|
||||
}
|
||||
|
||||
void utest_init_RNG() {
|
||||
|
||||
static unsigned char init = 0;
|
||||
|
|
|
|||
Reference in a new issue