diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2023-03-27 13:07:39 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2023-03-27 13:07:39 +0200 |
commit | 7cccceaf6b15981a3f441f55097dac5fa5395ccc (patch) | |
tree | 873482fae5ec8efdec9094aff827ce4c4804a388 /source/kit_test/test.h | |
parent | 108be944da53ddec282b65cb4d90d45cbb1dd84d (diff) | |
download | kit-7cccceaf6b15981a3f441f55097dac5fa5395ccc.zip |
[kit_test] REQUIRE_EQ
Diffstat (limited to 'source/kit_test/test.h')
-rw-r--r-- | source/kit_test/test.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/kit_test/test.h b/source/kit_test/test.h index 44aae09..8732366 100644 --- a/source/kit_test/test.h +++ b/source/kit_test/test.h @@ -19,7 +19,9 @@ extern "C" { # define KIT_TEST_ASSERTIONS_LIMIT 0x50 #endif -typedef void (*kit_test_report_fn)(int test_index, int line, int ok); +typedef void (*kit_test_report_fn)(int test_index, int line, + long long value, + long long expected); typedef void (*kit_test_run_fn)( int kit_test_index_, kit_test_report_fn kit_test_report_fn_); @@ -30,6 +32,8 @@ typedef struct { int assertions; int line[KIT_TEST_ASSERTIONS_LIMIT]; int status[KIT_TEST_ASSERTIONS_LIMIT]; + long long value[KIT_TEST_ASSERTIONS_LIMIT]; + long long expected[KIT_TEST_ASSERTIONS_LIMIT]; int signal; } kit_test_case_t; @@ -87,13 +91,17 @@ void kit_test_register(char const *name, char const *file, int kit_test_index_, kit_test_report_fn kit_test_report_fn_) #define KIT_REQUIRE(...) \ - kit_test_report_fn_(kit_test_index_, __LINE__, (__VA_ARGS__)) + kit_test_report_fn_(kit_test_index_, __LINE__, (__VA_ARGS__), 1) + +#define KIT_REQUIRE_EQ(...) \ + kit_test_report_fn_(kit_test_index_, __LINE__, __VA_ARGS__) int kit_run_tests(int argc, char **argv); #ifndef KIT_DISABLE_SHORT_NAMES # define TEST KIT_TEST # define REQUIRE KIT_REQUIRE +# define REQUIRE_EQ KIT_REQUIRE_EQ # define test_register kit_test_register # define run_tests kit_run_tests |