MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / TEST

Function TEST

source/test/clock_test.cpp:8–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6using namespace Star;
7
8TEST(ClockTest, All) {
9 Clock clock;
10
11 Thread::sleepPrecise(1000);
12
13 // Pick wide range in case the system is acting iffy, it's just to check that
14 // the clock is progressing properly.
15 EXPECT_GT(clock.time(), 0.8);
16 EXPECT_LT(clock.time(), 8.0);
17
18 double time = clock.time();
19 clock.stop();
20 Thread::sleepPrecise(1000);
21 EXPECT_EQ(clock.time(), time);
22
23 clock.reset();
24 EXPECT_EQ(clock.time(), 0.0);
25
26 Timer nullTimer;
27 EXPECT_TRUE(nullTimer.timeUp());
28 EXPECT_FALSE(nullTimer.running());
29}

Callers

nothing calls this directly

Calls 5

timeUpMethod · 0.80
timeMethod · 0.45
stopMethod · 0.45
resetMethod · 0.45
runningMethod · 0.45

Tested by

no test coverage detected