diff options
Diffstat (limited to 'tests/unit/test_framework.h')
| -rw-r--r-- | tests/unit/test_framework.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unit/test_framework.h b/tests/unit/test_framework.h index 6eb3a10..bdf93a3 100644 --- a/tests/unit/test_framework.h +++ b/tests/unit/test_framework.h | |||
| @@ -29,6 +29,17 @@ static int g_tests_failed = 0; | |||
| 29 | } \ | 29 | } \ |
| 30 | } while(0) | 30 | } while(0) |
| 31 | 31 | ||
| 32 | #define ASSERT_EQ_UINT64(expected, actual, msg) do { \ | ||
| 33 | unsigned long long _e = (unsigned long long)(expected), _a = (unsigned long long)(actual); \ | ||
| 34 | if (_e == _a) { \ | ||
| 35 | printf(" PASS: %s (got %llu)\n", msg, _a); \ | ||
| 36 | g_tests_passed++; \ | ||
| 37 | } else { \ | ||
| 38 | printf(" FAIL: %s (expected %llu, got %llu) at %s:%d\n", msg, _e, _a, __FILE__, __LINE__); \ | ||
| 39 | g_tests_failed++; \ | ||
| 40 | } \ | ||
| 41 | } while(0) | ||
| 42 | |||
| 32 | #define ASSERT_EQ_STR(expected, actual, msg) do { \ | 43 | #define ASSERT_EQ_STR(expected, actual, msg) do { \ |
| 33 | const char *_e = (expected), *_a = (actual); \ | 44 | const char *_e = (expected), *_a = (actual); \ |
| 34 | if (_e && _a && strcmp(_e, _a) == 0) { \ | 45 | if (_e && _a && strcmp(_e, _a) == 0) { \ |