Lines Matching full:timer
1 #include <sdbusplus/timer.hpp>
8 using sdbusplus::Timer;
22 // Add a Timer Object
23 Timer timer; member in TimerTest
26 TimerTest() : rc(sd_event_default(&events)), timer(events) in TimerTest()
29 // event handler and timer object. in TimerTest()
52 // Add a Timer Object
53 std::unique_ptr<Timer> timer = nullptr; member in TimerTestCallBack
68 // event handler and timer object. in TimerTestCallBack()
73 timer = std::make_unique<Timer>(events, func); in TimerTestCallBack()
83 /** @brief Makes sure that timer is expired and the
91 EXPECT_GE(timer.start(time), 0); in TEST_F()
96 while (count < 2 && !timer.isExpired()) in TEST_F()
105 EXPECT_EQ(true, timer.isExpired()); in TEST_F()
109 /** @brief Makes sure that timer is not expired
116 EXPECT_GE(timer.start(time), 0); in TEST_F()
118 // Now turn off the timer post a 1 second sleep in TEST_F()
120 EXPECT_GE(timer.stop(), 0); in TEST_F()
122 // Wait 2 seconds and see that timer is not expired in TEST_F()
133 EXPECT_EQ(false, timer.isExpired()); in TEST_F()
139 /** @brief Makes sure that timer value is changed in between
140 * and that the new timer expires
147 EXPECT_GE(timer.start(time), 0); in TEST_F()
154 EXPECT_GE(timer.start(time), 0); in TEST_F()
156 // Wait 3 seconds and see that timer is expired in TEST_F()
158 while (count < 3 && !timer.isExpired()) in TEST_F()
167 EXPECT_EQ(true, timer.isExpired()); in TEST_F()
171 /** @brief Makes sure that timer value is changed in between
172 * and turn off and make sure that timer does not expire
179 EXPECT_GE(timer.start(time), 0); in TEST_F()
186 EXPECT_GE(timer.start(time), 0); in TEST_F()
188 // Now turn off the timer post a 1 second sleep in TEST_F()
190 EXPECT_GE(timer.stop(), 0); in TEST_F()
192 // Wait 2 seconds and see that timer is expired in TEST_F()
203 EXPECT_EQ(false, timer.isExpired()); in TEST_F()
215 EXPECT_GE(timer->start(time), 0); in TEST_F()
220 while (count < 2 && !timer->isExpired()) in TEST_F()
229 EXPECT_EQ(true, timer->isExpired()); in TEST_F()
234 /** @brief Makes sure that timer is not expired
241 EXPECT_GE(timer->start(time), 0); in TEST_F()
243 // Now turn off the timer post a 1 second sleep in TEST_F()
245 EXPECT_GE(timer->stop(), 0); in TEST_F()
247 // Wait 2 seconds and see that timer is not expired in TEST_F()
258 EXPECT_EQ(false, timer->isExpired()); in TEST_F()