diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-02-18 13:26:44 +0100 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-03-22 11:56:01 -0700 |
commit | c587eefbb1290cc01e3e14a0ae18a2d316a498fd (patch) | |
tree | 85f3ba7e5997fa1d9d1a0305ce563741cb772d5d /test/util | |
parent | db5ac4785fdc02b4e233201bb3c6f55270e3c65d (diff) | |
download | qtlocation-mapboxgl-c587eefbb1290cc01e3e14a0ae18a2d316a498fd.tar.gz |
[ios] make unit tests work on iOS and iOS Simulator
Diffstat (limited to 'test/util')
-rw-r--r-- | test/util/assert.cpp | 2 | ||||
-rw-r--r-- | test/util/timer.cpp | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/test/util/assert.cpp b/test/util/assert.cpp index 8740bdb201..cf7baf8ca9 100644 --- a/test/util/assert.cpp +++ b/test/util/assert.cpp @@ -5,5 +5,5 @@ using namespace mbgl; TEST(Assert, Always) { - EXPECT_DEATH(assert_always(true == false), "failed assertion `true == false'"); + EXPECT_DEATH_IF_SUPPORTED(assert_always(true == false), "failed assertion `true == false'"); } diff --git a/test/util/timer.cpp b/test/util/timer.cpp index 71e35da919..f6253ab6d3 100644 --- a/test/util/timer.cpp +++ b/test/util/timer.cpp @@ -1,3 +1,5 @@ +#include <mbgl/test/util.hpp> + #include <mbgl/util/chrono.hpp> #include <mbgl/util/timer.hpp> #include <mbgl/util/run_loop.hpp> @@ -5,11 +7,9 @@ #include <memory> -#include <mbgl/test/util.hpp> - using namespace mbgl::util; -TEST(Timer, Basic) { +TEST(Timer, TEST_REQUIRES_ACCURATE_TIMING(Basic)) { RunLoop loop; Timer timer; @@ -33,7 +33,7 @@ TEST(Timer, Basic) { EXPECT_LE(totalTime, expectedTotalTime * 1.2); } -TEST(Timer, Repeat) { +TEST(Timer, TEST_REQUIRES_ACCURATE_TIMING(Repeat)) { RunLoop loop; Timer timer; @@ -59,7 +59,7 @@ TEST(Timer, Repeat) { EXPECT_LE(totalTime, expectedTotalTime * 1.2); } -TEST(Timer, Stop) { +TEST(Timer, TEST_REQUIRES_ACCURATE_TIMING(Stop)) { RunLoop loop; Timer timer1; @@ -95,7 +95,7 @@ TEST(Timer, Stop) { EXPECT_LE(totalTime, expectedTotalTime * 1.2); } -TEST(Timer, DestroyShouldStop) { +TEST(Timer, TEST_REQUIRES_ACCURATE_TIMING(DestroyShouldStop)) { RunLoop loop; auto timer1 = std::make_unique<Timer>(); @@ -131,7 +131,7 @@ TEST(Timer, DestroyShouldStop) { EXPECT_LE(totalTime, expectedTotalTime * 1.2); } -TEST(Timer, StartOverrides) { +TEST(Timer, TEST_REQUIRES_ACCURATE_TIMING(StartOverrides)) { RunLoop loop; Timer timer; @@ -165,7 +165,7 @@ TEST(Timer, StartOverrides) { EXPECT_LE(totalTime, expectedTotalTime * 1.2); } -TEST(Timer, CanStopNonStartedTimer) { +TEST(Timer, TEST_REQUIRES_ACCURATE_TIMING(CanStopNonStartedTimer)) { RunLoop loop; Timer timer; |