Convert to using sdeventplus
This gets rid of the ad-hoc timer class in favor of using the timer
source built into sdeventplus.
Tested:
Unit tests pass and everything still builds. Manually verified the
functionality is still in tact on a zaius machine.
Change-Id: I90619f0fe5a9fdfcecd24a49de672c0c99dc95e9
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/test/watchdog_test.hpp b/test/watchdog_test.hpp
index 50fa8f1..4c798a7 100644
--- a/test/watchdog_test.hpp
+++ b/test/watchdog_test.hpp
@@ -1,30 +1,33 @@
#include <chrono>
#include <memory>
-#include <timer_test.hpp>
+#include <sdbusplus/bus.hpp>
+#include <sdeventplus/event.hpp>
#include <watchdog.hpp>
+#include <gtest/gtest.h>
+
using namespace std::chrono;
using namespace std::chrono_literals;
// Test Watchdog functionality
-class WdogTest : public TimerTest
+class WdogTest : public ::testing::Test
{
public:
// Gets called as part of each TEST_F construction
WdogTest() :
+ event(sdeventplus::Event::get_default()),
bus(sdbusplus::bus::new_default()),
wdog(std::make_unique<phosphor::watchdog::Watchdog>(bus, TEST_PATH,
- eventP)),
+ event)),
defaultInterval(milliseconds(wdog->interval())), defaultDrift(30)
{
- // Check for successful creation of
- // event handler and bus handler
- EXPECT_GE(rc, 0);
-
// Initially the watchdog would be disabled
EXPECT_FALSE(wdog->enabled());
}
+ // sdevent Event handle
+ sdeventplus::Event event;
+
// sdbusplus handle
sdbusplus::bus::bus bus;