diff options
| author | Tyge Løvset <[email protected]> | 2022-08-18 22:24:46 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-08-18 22:24:46 +0200 |
| commit | 70395a84f5d69c96ed669e1ceba69fd2eaa826df (patch) | |
| tree | f08d1d45b9be017a25bb7420547cb29a5da2eb20 /include/stc | |
| parent | 9b88bb4ade7f5485e8d4db7956188c02bcaa3612 (diff) | |
| download | STC-modified-70395a84f5d69c96ed669e1ceba69fd2eaa826df.tar.gz STC-modified-70395a84f5d69c96ed669e1ceba69fd2eaa826df.zip | |
Last updates on stctest.
Diffstat (limited to 'include/stc')
| -rw-r--r-- | include/stc/stctest.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/stc/stctest.h b/include/stc/stctest.h index 6b6abd05..27e31ac4 100644 --- a/include/stc/stctest.h +++ b/include/stc/stctest.h @@ -68,11 +68,17 @@ #define STCTEST_FLOAT_LIMIT 0.00000001
-#define EXPECT_TRUE(expression) \
- do { if (!_stctest_assert(__FILE__, __LINE__, #expression, (expression) != 0)) puts(""); } while(0)
+#define EXPECT_TRUE(expr) \
+ do { if (!_stctest_assert(__FILE__, __LINE__, #expr, (expr) != 0)) puts(""); } while(0)
-#define EXPECT_FALSE(expression) \
- do { if (!_stctest_assert(__FILE__, __LINE__, #expression, (expression) == 0)) puts(""); } while(0)
+#define EXPECT_TRUE1(expr, v) \
+ do { if (!_stctest_assert(__FILE__, __LINE__, #expr, (expr) != 0)) { \
+ char _fmt[32]; sprintf(_fmt, ": %%s = %s\n", _stctest_FMT(v)); \
+ printf(_fmt, #v, v); \
+ }} while (0)
+
+#define EXPECT_FALSE(expr) EXPECT_TRUE(!(expr))
+#define EXPECT_FALSE1(expr, v) EXPECT_TRUE1(!(expr), v)
/* NB! (char*) are compared as strings. Cast to (void*) to compare pointers only */
#define EXPECT_EQ(a, b) _stctest_CHECK(a, ==, b)
|
