We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ASSERT_ERROR
1 parent 8fab811 commit c5474cdCopy full SHA for c5474cd
offload/unittests/OffloadAPI/common/Fixtures.hpp
@@ -40,12 +40,16 @@
40
} while (0)
41
#endif
42
43
-// TODO: rework this so the EXPECTED/ACTUAL results are readable
44
#ifndef ASSERT_ERROR
45
#define ASSERT_ERROR(EXPECTED, ACTUAL) \
46
do { \
47
ol_result_t Res = ACTUAL; \
48
- ASSERT_TRUE(Res && (Res->Code == EXPECTED)); \
+ if (!Res) \
+ GTEST_FAIL() << #ACTUAL " succeeded when we expected it to fail"; \
49
+ if (Res->Code != EXPECTED) \
50
+ GTEST_FAIL() << #ACTUAL " was expected to return " \
51
+ << #EXPECTED " but instead returned " << Res->Code << ": " \
52
+ << Res->Details; \
53
54
55
0 commit comments