Skip to content

Commit 4fccb76

Browse files
committed
Removed conditional compile around FixtureDtorThrows structure. Added a preprocessor block for _MSC_VER noexcept support.
1 parent 24061e4 commit 4fccb76

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

tests/TestTestMacros.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ using namespace std;
3232
#endif
3333
#endif
3434
#endif
35+
36+
#elif _MSC_VER
37+
38+
#if (_MSC_VER > 1800)
39+
#define _NOEXCEPT_OP(x) noexcept(x)
40+
#else
41+
#define _NOEXCEPT_OP(x)
42+
#endif
43+
3544
#endif
3645

3746
namespace {
@@ -160,11 +169,6 @@ TEST(FixturesWithThrowingCtorsAreFailures)
160169
CHECK(strstr(reporter.lastFailedMessage, "while constructing fixture"));
161170
}
162171

163-
// Visual Studio 2015 in compliance with C++11 standard
164-
// implicitly adds a 'noexcept' to all user defined
165-
// destructors. Any exceptions thrown from destructors
166-
// cause abort() to be called on the process.
167-
#if(_MSC_VER < 1900)
168172
struct FixtureDtorThrows
169173
{
170174
~FixtureDtorThrows() _NOEXCEPT_OP(false) { throw "exception"; }
@@ -190,7 +194,6 @@ TEST(FixturesWithThrowingDtorsAreFailures)
190194
CHECK_EQUAL(1, failureCount);
191195
CHECK(strstr(reporter.lastFailedMessage, "while destroying fixture"));
192196
}
193-
#endif
194197

195198
const int FailingLine = 123;
196199

0 commit comments

Comments
 (0)