Skip to content

Commit 240bf00

Browse files
committed
Merge branch 'paxos1977-paxos1977-pjohnmeyer-RequiredMacro'
2 parents 9fd7b22 + 898f18d commit 240bf00

File tree

5 files changed

+751
-9
lines changed

5 files changed

+751
-9
lines changed

UnitTest++/ExceptionMacros.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#else
1313
#define UT_TRY(x) x
1414
#define UT_THROW(x)
15-
#define UT_RETHROW()
15+
#define UT_RETHROW(ExceptionType)
1616
#define UT_CATCH(ExceptionType, ExceptionName, CatchBody)
1717
#define UT_CATCH_ALL(CatchBody)
1818
#endif

UnitTest++/RequireMacros.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@
77
#error UnitTest++ redefines REQUIRE
88
#endif
99

10-
#ifndef UNITTEST_NO_EXCEPTIONS
11-
#define REQUIRE for(UnitTest::RequiredCheckTestReporter decoratedReporter(*UnitTest::CurrentTest::Results()); decoratedReporter.Next(); )
12-
#endif
10+
#define REQUIRE for(UnitTest::RequiredCheckTestReporter decoratedReporter(*UnitTest::CurrentTest::Results()); decoratedReporter.Next(); )
1311

14-
#ifdef UNITTEST_NO_EXCEPTIONS
15-
#define REQUIRE
1612
#endif
17-
18-
#endif

UnitTest++/ThrowingTestReporter.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#include "ThrowingTestReporter.h"
22
#include "RequiredCheckException.h"
33

4+
#ifdef UNITTEST_NO_EXCEPTIONS
5+
#include "ReportAssertImpl.h"
6+
#endif
7+
48
namespace UnitTest {
59

610
ThrowingTestReporter::ThrowingTestReporter(TestReporter* decoratedReporter)
@@ -27,7 +31,13 @@ namespace UnitTest {
2731
{
2832
m_decoratedReporter->ReportFailure(test, failure);
2933
}
30-
throw RequiredCheckException();
34+
35+
#ifndef UNITTEST_NO_EXCEPTIONS
36+
throw RequiredCheckException();
37+
#else
38+
static const int stopTest = 1;
39+
UNITTEST_LONGJMP(*UnitTest::Detail::GetAssertJmpBuf(), stopTest);
40+
#endif
3141
}
3242

3343
//virtual

0 commit comments

Comments
 (0)