mirror of
https://github.com/unittest-cpp/unittest-cpp
synced 2026-09-26 16:19:30 +03:00
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 #76.
This commit is contained in:
parent
ae24d94242
commit
c4e36176d9
1 changed files with 6 additions and 0 deletions
|
|
@ -136,6 +136,11 @@ TEST(FixturesWithThrowingCtorsAreFailures)
|
|||
CHECK(strstr(reporter.lastFailedMessage, "while constructing fixture"));
|
||||
}
|
||||
|
||||
// Visual Studio 2015 in compliance with C++11 standard
|
||||
// implicitly adds a 'noexcept' to all user defined
|
||||
// destructors. Any exceptions thrown from destructors
|
||||
// cause abort() to be called on the process.
|
||||
#if(_MSC_VER < 1900)
|
||||
struct FixtureDtorThrows
|
||||
{
|
||||
~FixtureDtorThrows() { throw "exception"; }
|
||||
|
|
@ -161,6 +166,7 @@ TEST(FixturesWithThrowingDtorsAreFailures)
|
|||
CHECK_EQUAL(1, failureCount);
|
||||
CHECK(strstr(reporter.lastFailedMessage, "while destroying fixture"));
|
||||
}
|
||||
#endif
|
||||
|
||||
const int FailingLine = 123;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue