Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Commit c4e3617

Browse files
committed
Disable tests in TestTestMacros.cpp which throw exceptions from user
defined destructors. In accordance with the C++11 standard, Visual Studio 2015 adds an implicit 'noexcept' to all user defined destructors. Any destructor throwing an exception causes abort() to be called on the process. This commit fixes unittest-cpp#76.
1 parent ae24d94 commit c4e3617

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/TestTestMacros.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ TEST(FixturesWithThrowingCtorsAreFailures)
136136
CHECK(strstr(reporter.lastFailedMessage, "while constructing fixture"));
137137
}
138138

139+
// Visual Studio 2015 in compliance with C++11 standard
140+
// implicitly adds a 'noexcept' to all user defined
141+
// destructors. Any exceptions thrown from destructors
142+
// cause abort() to be called on the process.
143+
#if(_MSC_VER < 1900)
139144
struct FixtureDtorThrows
140145
{
141146
~FixtureDtorThrows() { throw "exception"; }
@@ -161,6 +166,7 @@ TEST(FixturesWithThrowingDtorsAreFailures)
161166
CHECK_EQUAL(1, failureCount);
162167
CHECK(strstr(reporter.lastFailedMessage, "while destroying fixture"));
163168
}
169+
#endif
164170

165171
const int FailingLine = 123;
166172

0 commit comments

Comments
 (0)