|
5 | 5 | #include <targetmock.h> |
6 | 6 | #include <randomgeneratormock.h> |
7 | 7 |
|
8 | | -#define ASSERT_NUM_OP1(utils, type, rawArg, v) ASSERT_EQ(utils.getOpResult(type, rawArg, v).toDouble(), m_utils.getExpectedOpResult(type, v).toDouble()); |
9 | | -#define ASSERT_NUM_OP2(utils, type, rawArgs, v1, v2) ASSERT_EQ(utils.getOpResult(type, rawArgs, v1, v2).toDouble(), m_utils.getExpectedOpResult(type, v1, v2).toDouble()); |
| 8 | +#define ASSERT_NUM_OP1(utils, type, rawArg, v) \ |
| 9 | + Value result = utils.getOpResult(type, rawArg, v); \ |
| 10 | + Value expected = utils.getExpectedOpResult(type, v); \ |
| 11 | + ASSERT_EQ(result.isNaN(), expected.isNaN()); \ |
| 12 | + ASSERT_EQ(result.toDouble(), expected.toDouble()); |
| 13 | + |
| 14 | +#define ASSERT_NUM_OP2(utils, type, rawArgs, v1, v2) \ |
| 15 | + Value result = utils.getOpResult(type, rawArgs, v1, v2); \ |
| 16 | + Value expected = utils.getExpectedOpResult(type, v1, v2); \ |
| 17 | + ASSERT_EQ(result.isNaN(), expected.isNaN()); \ |
| 18 | + ASSERT_EQ(result.toDouble(), expected.toDouble()); |
10 | 19 |
|
11 | 20 | #define ASSERT_BOOL_OP1(utils, type, rawArg, v) ASSERT_EQ(utils.getOpResult(type, rawArg, v).toBool(), m_utils.getExpectedOpResult(type, v).toBool()); |
12 | 21 | #define ASSERT_BOOL_OP2(utils, type, rawArgs, v1, v2) ASSERT_EQ(utils.getOpResult(type, rawArgs, v1, v2).toBool(), m_utils.getExpectedOpResult(type, v1, v2).toBool()); |
|
0 commit comments