diff options
author | Danny van Kooten <dannyvankooten@users.noreply.github.com> | 2020-03-16 14:06:02 +0100 |
---|---|---|
committer | Danny van Kooten <dannyvankooten@users.noreply.github.com> | 2020-03-16 14:06:02 +0100 |
commit | 31e98ced014b9326ddfc990b003864df69cd4dcc (patch) | |
tree | 6a7b55b591c7152adac7110804c174d6dd05564d /tests/test.h | |
parent | 19597032cdbaba1271e8134f865f56410d886c11 (diff) | |
download | unja-31e98ced014b9326ddfc990b003864df69cd4dcc.tar.gz unja-31e98ced014b9326ddfc990b003864df69cd4dcc.zip |
return old values when inserting or removing from hashmap
Diffstat (limited to 'tests/test.h')
-rw-r--r-- | tests/test.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test.h b/tests/test.h index f860ee2..7a82d08 100644 --- a/tests/test.h +++ b/tests/test.h @@ -6,6 +6,8 @@ #define START_TESTS int main() { #define END_TESTS } #define TEST(name) strcpy(current_test, #name); +#define assert_null(actual) _assert(actual == NULL, __FILE__, __LINE__, "invalid value: expected NULL, got %s", actual) + #define assert_str(actual, expected) _assert(actual != NULL && strcmp(actual, expected) == 0, __FILE__, __LINE__, "invalid string: expected %s, got %s", expected, actual) #define assert(assertion, format, ...) _assert(assertion, __FILE__, __LINE__, format, ##__VA_ARGS__) #define ARRAY_SIZE(arr) sizeof arr / sizeof arr[0] |