13 #include <gtest/gtest.h>
14 #include "../../include/ecl/time/snooze.hpp"
15 #include "../../include/ecl/time/timestamp.hpp"
23 #if defined(ECL_IS_POSIX)
37 TEST(SnoozeTests,snoozeConfigured) {
41 snooze.period(duration);
42 Snooze snooze_from_duration(duration);
43 Snooze snooze_with_validation(duration,
true);
48 TEST(SnoozeTests,setGetPeriod) {
51 snooze.period(duration);
52 double period = snooze.period();
53 EXPECT_FLOAT_EQ(0.5,period);
56 TEST(SnoozeTests,snooze) {
58 Snooze snooze(duration);
59 TimeStamp start, finish;
63 double difference = finish - start;
64 EXPECT_LT(0.5, difference);
65 EXPECT_GT(1.0, difference);
74 int main(
int argc,
char **argv) {
76 testing::InitGoogleTest(&argc,argv);
77 return RUN_ALL_TESTS();