diff options
| author | Tyge Lovset <[email protected]> | 2022-08-23 13:47:19 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2022-08-23 13:47:19 +0200 |
| commit | 1fe32468be872bf99698bc899164d56d6b6c80c5 (patch) | |
| tree | 33f29d9734d0506c29b60047a7311d3b37ca58ea /include | |
| parent | e8f5177eb163cb7ab274f45b946bd65ae36617e5 (diff) | |
| download | STC-modified-1fe32468be872bf99698bc899164d56d6b6c80c5.tar.gz STC-modified-1fe32468be872bf99698bc899164d56d6b6c80c5.zip | |
Minor tuning in stctest.h
Diffstat (limited to 'include')
| -rw-r--r-- | include/stc/stctest.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/stc/stctest.h b/include/stc/stctest.h index 4120a800..9718af7f 100644 --- a/include/stc/stctest.h +++ b/include/stc/stctest.h @@ -70,11 +70,11 @@ #define EXPECT_TRUE(expr) \
- do { if (!_stctest_assert(__FILE__, __LINE__, #expr, (expr) != 0)) puts(""); } while(0)
+ do { if (!_stctest_assert(__FILE__, __LINE__, #expr, (expr) != 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)); \
+ char _fmt[32]; sprintf(_fmt, " ; %%s --> %s\n", _stctest_FMT(v)); \
printf(_fmt, #v, v); \
}} while (0)
@@ -88,7 +88,7 @@ #define EXPECT_LT(a, b) _stctest_CHECK(a, <, b, -STC_DOUBLE_EPSILON)
#define EXPECT_LE(a, b) _stctest_CHECK(a, <=, b, -STC_DOUBLE_EPSILON)
#define EXPECT_GE(a, b) _stctest_CHECK(a, >=, b, -STC_DOUBLE_EPSILON)
-#define EXPECT_FLOAT_EQ(a, b) _stctest_CHECK((double)(a), ==, (double)(b), -STC_FLOAT_EPSILON)
+#define EXPECT_FLOAT_EQ(a, b) _stctest_CHECK((float)(a), ==, (float)(b), -STC_FLOAT_EPSILON)
#define EXPECT_DOUBLE_EQ(a, b) _stctest_CHECK((double)(a), ==, (double)(b), -STC_DOUBLE_EPSILON)
#define EXPECT_NEAR(a, b, abs_error) _stctest_CHECK((double)(a), ==, (double)(b), abs_error)
@@ -122,7 +122,7 @@ default: _stctest_valcmp)((a) OP (b), #OP, a, b, (double)(e))
#define _stctest_FMT(a) _Generic((a), \
- float: "%.7gf", double: "%.14g", \
+ float: "%.8gf", double: "%.15g", \
int64_t: "%" PRId64, int32_t: "%" PRId32, int16_t: "%" PRId16, int8_t: "%" PRId8, \
uint64_t: "%" PRIu64 "u", uint32_t: "%" PRIu32 "u", uint16_t: "%" PRIu16 "u", uint8_t: "%" PRIu8 "u", \
char*: "`%s`", const char*: "`%s`", \
|
