mirror of
https://github.com/unittest-cpp/unittest-cpp
synced 2026-09-26 16:19:30 +03:00
commit
dc6b908380
5 changed files with 50 additions and 11 deletions
|
|
@ -10,6 +10,30 @@
|
|||
using namespace UnitTest;
|
||||
using namespace std;
|
||||
|
||||
/* test for c++11 support */
|
||||
#ifndef _MSC_VER
|
||||
|
||||
/* Test for clang >= 3.3 */
|
||||
#ifdef __clang__
|
||||
#if (__clang__ == 1) && (__clang_major__ > 3 || (__clang_major__ == 3 && (__clang_minor__ > 2 )))
|
||||
#define _NOEXCEPT_OP(x) noexcept(x)
|
||||
#else
|
||||
#define _NOEXCEPT_OP(x)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __clang__
|
||||
/* Test for GCC >= 4.8.0 */
|
||||
#ifdef __GNUC__
|
||||
#if (__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ > 7 ))
|
||||
#define _NOEXCEPT_OP(x) noexcept(x)
|
||||
#else
|
||||
#define _NOEXCEPT_OP(x)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
TestList list1;
|
||||
|
|
@ -143,7 +167,7 @@ TEST(FixturesWithThrowingCtorsAreFailures)
|
|||
#if(_MSC_VER < 1900)
|
||||
struct FixtureDtorThrows
|
||||
{
|
||||
~FixtureDtorThrows() { throw "exception"; }
|
||||
~FixtureDtorThrows() _NOEXCEPT_OP(false) { throw "exception"; }
|
||||
};
|
||||
|
||||
TestList throwingFixtureTestList2;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ TEST(TimeConstraintSucceedsWithFastTest)
|
|||
TestResults result;
|
||||
{
|
||||
ScopedCurrentTest scopedResult(result);
|
||||
TimeConstraint t(200, TestDetails("", "", "", 0));
|
||||
TimeConstraint t(200, TestDetails("", "", "", 0), 0);
|
||||
TimeHelpers::SleepMs(5);
|
||||
}
|
||||
CHECK_EQUAL(0, result.GetFailureCount());
|
||||
|
|
@ -25,7 +25,7 @@ TEST(TimeConstraintFailsWithSlowTest)
|
|||
TestResults result;
|
||||
{
|
||||
ScopedCurrentTest scopedResult(result);
|
||||
TimeConstraint t(10, TestDetails("", "", "", 0));
|
||||
TimeConstraint t(10, TestDetails("", "", "", 0),0);
|
||||
TimeHelpers::SleepMs(20);
|
||||
}
|
||||
CHECK_EQUAL(1, result.GetFailureCount());
|
||||
|
|
@ -39,7 +39,7 @@ TEST(TimeConstraintFailureIncludesCorrectData)
|
|||
ScopedCurrentTest scopedResult(result);
|
||||
|
||||
TestDetails const details("testname", "suitename", "filename", 10);
|
||||
TimeConstraint t(10, details);
|
||||
TimeConstraint t(10, details,10);
|
||||
TimeHelpers::SleepMs(20);
|
||||
}
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ TEST(TimeConstraintFailureIncludesTimeoutInformation)
|
|||
TestResults result(&reporter);
|
||||
{
|
||||
ScopedCurrentTest scopedResult(result);
|
||||
TimeConstraint t(10, TestDetails("", "", "", 0));
|
||||
TimeConstraint t(10, TestDetails("", "", "", 0),0);
|
||||
TimeHelpers::SleepMs(20);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue