summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2019-01-16 16:58:14 -0800
committerWilliam A. Kennington III <wak@google.com>2019-01-16 17:04:14 -0800
commit8cf5f64c9e566326dabd79abaf405b85dc8f8018 (patch)
tree1dc957d523d5b42188447534f458b48dfa8b22ce
parentaf60e63080725d99bf0b1b11acab00b8403baca3 (diff)
downloadphosphor-watchdog-8cf5f64c9e566326dabd79abaf405b85dc8f8018.tar.gz
phosphor-watchdog-8cf5f64c9e566326dabd79abaf405b85dc8f8018.zip
test/watchdog: Don't use designated initializers
gcc supported this in c++ even though it was non-standard until c++2a is complete. This change removes designated initializers to make our tests compliant with std++17. Tested: Built and run through unit tests. Change-Id: I846394c633c0396518db6ed41682bbcf05b890c6 Signed-off-by: William A. Kennington III <wak@google.com>
-rw-r--r--test/watchdog.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/test/watchdog.cpp b/test/watchdog.cpp
index 66cca7e..fd8988f 100644
--- a/test/watchdog.cpp
+++ b/test/watchdog.cpp
@@ -214,10 +214,10 @@ TEST_F(WdogTest, enableWdogWithFallbackTillEnd)
// We need to make a wdog with the right fallback options
// The interval is set to be noticeably different from the default
// so we can always tell the difference
- Watchdog::Fallback fallback{
- .action = Watchdog::Action::PowerOff,
- .interval = static_cast<uint64_t>(fallbackIntervalMs),
- };
+ Watchdog::Fallback fallback;
+ fallback.action = Watchdog::Action::PowerOff;
+ fallback.interval = static_cast<uint64_t>(fallbackIntervalMs);
+ fallback.always = false;
wdog = std::make_unique<Watchdog>(bus, TEST_PATH, event,
Watchdog::ActionTargetMap(),
std::move(fallback));
@@ -296,11 +296,10 @@ TEST_F(WdogTest, enableWdogWithFallbackReEnable)
// We need to make a wdog with the right fallback options
// The interval is set to be noticeably different from the default
// so we can always tell the difference
- Watchdog::Fallback fallback{
- .action = Watchdog::Action::PowerOff,
- .interval = static_cast<uint64_t>(fallbackIntervalMs),
- .always = false,
- };
+ Watchdog::Fallback fallback;
+ fallback.action = Watchdog::Action::PowerOff;
+ fallback.interval = static_cast<uint64_t>(fallbackIntervalMs);
+ fallback.always = false;
wdog = std::make_unique<Watchdog>(bus, TEST_PATH, event,
Watchdog::ActionTargetMap(),
std::move(fallback));
@@ -350,11 +349,10 @@ TEST_F(WdogTest, enableWdogWithFallbackAlways)
// We need to make a wdog with the right fallback options
// The interval is set to be noticeably different from the default
// so we can always tell the difference
- Watchdog::Fallback fallback{
- .action = Watchdog::Action::PowerOff,
- .interval = static_cast<uint64_t>(fallbackIntervalMs),
- .always = true,
- };
+ Watchdog::Fallback fallback;
+ fallback.action = Watchdog::Action::PowerOff;
+ fallback.interval = static_cast<uint64_t>(fallbackIntervalMs);
+ fallback.always = true;
wdog = std::make_unique<Watchdog>(bus, TEST_PATH, event,
Watchdog::ActionTargetMap(),
std::move(fallback));
OpenPOWER on IntegriCloud