|
38 | 38 | #define CHECK(value) \
|
39 | 39 | UNITTEST_MULTILINE_MACRO_BEGIN \
|
40 | 40 | UT_TRY \
|
41 |
| - ({ \ |
| 41 | + ({ \ |
42 | 42 | if (!UnitTest::Check(value)) \
|
43 | 43 | UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), #value); \
|
44 | 44 | }) \
|
45 |
| - UT_CATCH (UnitTest::RequiredCheckException, , \ |
46 |
| - { \ |
47 |
| - UT_THROW(); \ |
48 |
| - }) \ |
| 45 | + UT_RETHROW (UnitTest::RequiredCheckException) \ |
49 | 46 | UT_CATCH (std::exception, e, \
|
50 | 47 | { \
|
51 | 48 | UnitTest::MemoryOutStream message; \
|
|
63 | 60 | #define CHECK_EQUAL(expected, actual) \
|
64 | 61 | UNITTEST_MULTILINE_MACRO_BEGIN \
|
65 | 62 | UT_TRY \
|
66 |
| - ({ \ |
| 63 | + ({ \ |
67 | 64 | UnitTest::CheckEqual(*UnitTest::CurrentTest::Results(), expected, actual, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \
|
68 | 65 | }) \
|
69 |
| - UT_CATCH (UnitTest::RequiredCheckException, , \ |
70 |
| - { \ |
71 |
| - UT_THROW(); \ |
72 |
| - }) \ |
| 66 | + UT_RETHROW (UnitTest::RequiredCheckException) \ |
73 | 67 | UT_CATCH (std::exception, e, \
|
74 | 68 | { \
|
75 | 69 | UnitTest::MemoryOutStream message; \
|
|
78 | 72 | message.GetText()); \
|
79 | 73 | }) \
|
80 | 74 | UT_CATCH_ALL \
|
81 |
| - ({ \ |
| 75 | + ({ \ |
82 | 76 | UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), \
|
83 | 77 | "Unhandled exception in CHECK_EQUAL(" #expected ", " #actual ")"); \
|
84 | 78 | }) \
|
|
87 | 81 | #define CHECK_CLOSE(expected, actual, tolerance) \
|
88 | 82 | UNITTEST_MULTILINE_MACRO_BEGIN \
|
89 | 83 | UT_TRY \
|
90 |
| - ({ \ |
| 84 | + ({ \ |
91 | 85 | UnitTest::CheckClose(*UnitTest::CurrentTest::Results(), expected, actual, tolerance, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \
|
92 | 86 | }) \
|
93 |
| - UT_CATCH (UnitTest::RequiredCheckException, , \ |
94 |
| - { \ |
95 |
| - UT_THROW(); \ |
96 |
| - }) \ |
| 87 | + UT_RETHROW (UnitTest::RequiredCheckException) \ |
97 | 88 | UT_CATCH (std::exception, e, \
|
98 | 89 | { \
|
99 | 90 | UnitTest::MemoryOutStream message; \
|
|
102 | 93 | message.GetText()); \
|
103 | 94 | }) \
|
104 | 95 | UT_CATCH_ALL \
|
105 |
| - ({ \ |
| 96 | + ({ \ |
106 | 97 | UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), \
|
107 | 98 | "Unhandled exception in CHECK_CLOSE(" #expected ", " #actual ")"); \
|
108 | 99 | }) \
|
|
114 | 105 | ({ \
|
115 | 106 | UnitTest::CheckArrayEqual(*UnitTest::CurrentTest::Results(), expected, actual, count, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \
|
116 | 107 | }) \
|
117 |
| - UT_CATCH (UnitTest::RequiredCheckException, , \ |
118 |
| - { \ |
119 |
| - UT_THROW(); \ |
120 |
| - }) \ |
| 108 | + UT_RETHROW (UnitTest::RequiredCheckException) \ |
121 | 109 | UT_CATCH (std::exception, e, \
|
122 | 110 | { \
|
123 | 111 | UnitTest::MemoryOutStream message; \
|
|
138 | 126 | ({ \
|
139 | 127 | UnitTest::CheckArrayClose(*UnitTest::CurrentTest::Results(), expected, actual, count, tolerance, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \
|
140 | 128 | }) \
|
141 |
| - UT_CATCH (UnitTest::RequiredCheckException, , \ |
142 |
| - { \ |
143 |
| - UT_THROW(); \ |
144 |
| - }) \ |
| 129 | + UT_RETHROW (UnitTest::RequiredCheckException) \ |
145 | 130 | UT_CATCH (std::exception, e, \
|
146 | 131 | { \
|
147 | 132 | UnitTest::MemoryOutStream message; \
|
|
162 | 147 | ({ \
|
163 | 148 | UnitTest::CheckArray2DClose(*UnitTest::CurrentTest::Results(), expected, actual, rows, columns, tolerance, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \
|
164 | 149 | }) \
|
165 |
| - UT_CATCH (UnitTest::RequiredCheckException, , \ |
166 |
| - { \ |
167 |
| - UT_THROW(); \ |
168 |
| - }) \ |
| 150 | + UT_RETHROW (UnitTest::RequiredCheckException) \ |
169 | 151 | UT_CATCH (std::exception, e, \
|
170 | 152 | { \
|
171 | 153 | UnitTest::MemoryOutStream message; \
|
|
0 commit comments