Added is_equal_arr and not functions
This commit is contained in:
parent
7c262a29e4
commit
732624c429
@ -18,9 +18,11 @@ run_tests();
|
|||||||
|
|
||||||
You can use the following functions or just pass boolean value as first argument of `test()`
|
You can use the following functions or just pass boolean value as first argument of `test()`
|
||||||
|
|
||||||
* `int is_equal(void *res, void *correct);`
|
- `int is_equal(void *res, void *correct)`
|
||||||
* `int is_true(void *res);`
|
- `int is_true(void *res)`
|
||||||
* `int is_false(void *res);`
|
- `int is_false(void *res)`
|
||||||
|
- `int is_equal_array(void **res, int size, void **correct)`
|
||||||
|
- `int not(void *res)`
|
||||||
|
|
||||||
# Installation:
|
# Installation:
|
||||||
|
|
||||||
|
@ -4,5 +4,7 @@
|
|||||||
int is_equal(void *res, void *correct);
|
int is_equal(void *res, void *correct);
|
||||||
int is_true(void *res);
|
int is_true(void *res);
|
||||||
int is_false(void *res);
|
int is_false(void *res);
|
||||||
|
int is_equal_array(void **res, int size, void **correct);
|
||||||
|
int not(void *res);
|
||||||
|
|
||||||
#endif
|
#endif
|
15
src/funcs.c
15
src/funcs.c
@ -14,3 +14,18 @@ int is_false(void *res)
|
|||||||
{
|
{
|
||||||
return !res;
|
return !res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int is_equal_array(void **res, int size, void **correct)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < size; i++)
|
||||||
|
if (res[i])
|
||||||
|
if (res[i] != correct[i])
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int not(void *res)
|
||||||
|
{
|
||||||
|
return !res;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user