Skip to content

Commit 76df02a

Browse files
committed
Fix fmod's smoke tests.
1 parent 5889305 commit 76df02a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

libc/test/src/math/smoke/FModTest.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@
1818
#include "hdr/fenv_macros.h"
1919

2020
#define TEST_SPECIAL(x, y, expected, dom_err, expected_exception) \
21-
LIBC_NAMESPACE::fputil::clear_except(FE_ALL_EXCEPT); \
22-
EXPECT_FP_EQ(expected, f(x, y)); \
23-
EXPECT_MATH_ERRNO((dom_err) ? EDOM : 0); \
24-
EXPECT_FP_EXCEPTION(expected_exception); \
25-
LIBC_NAMESPACE::fputil::clear_except(FE_ALL_EXCEPT)
21+
do { \
22+
LIBC_NAMESPACE::fputil::clear_except(FE_ALL_EXCEPT); \
23+
EXPECT_FP_EQ(expected, f(x, y)); \
24+
EXPECT_MATH_ERRNO((dom_err) ? EDOM : 0); \
25+
if (expected_exception < FE_ALL_EXCEPT) \
26+
EXPECT_FP_EXCEPTION(expected_exception); \
27+
} while (0)
2628

27-
#define TEST_REGULAR(x, y, expected) TEST_SPECIAL(x, y, expected, false, 0)
29+
#define TEST_REGULAR(x, y, expected) \
30+
TEST_SPECIAL(x, y, expected, false, FE_ALL_EXCEPT)
2831

2932
template <typename T>
3033
class FmodTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {

0 commit comments

Comments
 (0)