Skip to content

Commit fbd26ba

Browse files
Fix linux compiler error
1 parent fb2be19 commit fbd26ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/amulet/test_utils/test_utils.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ std::string cast_to_string(const T& obj)
5151
if (!(OP_FUNC)) { \
5252
std::string assert_comp_msg; \
5353
assert_comp_msg.reserve(200); \
54-
assert_comp_msg += "A " #OP " B failed in file "; \
54+
assert_comp_msg += "A " OP " B failed in file "; \
5555
assert_comp_msg += __FILE__; \
5656
assert_comp_msg += " at line "; \
5757
assert_comp_msg += std::to_string(__LINE__); \
@@ -68,7 +68,7 @@ std::string cast_to_string(const T& obj)
6868
} \
6969
}
7070

71-
#define _ASSERT_COMPARE(CLS, A, B, OP) _ASSERT_COMPARE_2(CLS, A, B, assert_comp_a OP assert_comp_b, OP)
71+
#define _ASSERT_COMPARE(CLS, A, B, OP) _ASSERT_COMPARE_2(CLS, A, B, assert_comp_a OP assert_comp_b, #OP)
7272

7373
#define ASSERT_EQUAL(CLS, A, B) _ASSERT_COMPARE(CLS, A, B, ==)
7474
#define ASSERT_NOT_EQUAL(CLS, A, B) _ASSERT_COMPARE(CLS, A, B, !=)
@@ -106,7 +106,7 @@ std::string cast_to_string(const T& obj)
106106
} \
107107
}
108108

109-
#define ASSERT_ALMOST_EQUAL_2(CLS, A, B, ERR) _ASSERT_COMPARE_2(CLS, A, B, std::abs(assert_comp_a - assert_comp_b) <= ERR, )
109+
#define ASSERT_ALMOST_EQUAL_2(CLS, A, B, ERR) _ASSERT_COMPARE_2(CLS, A, B, std::abs(assert_comp_a - assert_comp_b) <= ERR, "")
110110
#define ASSERT_ALMOST_EQUAL(CLS, A, B) ASSERT_ALMOST_EQUAL_2(CLS, A, B, 0.000001)
111-
#define ASSERT_NOT_ALMOST_EQUAL_2(CLS, A, B, ERR) _ASSERT_COMPARE_2(CLS, A, B, std::abs(assert_comp_a - assert_comp_b) > ERR, )
111+
#define ASSERT_NOT_ALMOST_EQUAL_2(CLS, A, B, ERR) _ASSERT_COMPARE_2(CLS, A, B, std::abs(assert_comp_a - assert_comp_b) > ERR, "")
112112
#define ASSERT_NOT_ALMOST_EQUAL(CLS, A, B) ASSERT_NOT_ALMOST_EQUAL_2(CLS, A, B, 0.000001)

0 commit comments

Comments
 (0)