Remove code duplication from trigger actions
Logging actions were using duplicated functions for discrete::Severity
and numeric::Type conversion. They were replaced with common utility
functions.
Testing done:
- UTs are passing.
- Logging actions are unchanged and working properly.
Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
Change-Id: I353d5f58fc82809c59bc2c1fb3b926d1a6579098
diff --git a/tests/src/test_trigger_actions.cpp b/tests/src/test_trigger_actions.cpp
index d3e36b8..911197f 100644
--- a/tests/src/test_trigger_actions.cpp
+++ b/tests/src/test_trigger_actions.cpp
@@ -60,8 +60,7 @@
TEST_P(TestLogToJournalNumericThrow, commitAnActionExpectThrow)
{
- EXPECT_THROW(sut->commit("Test", Milliseconds{100'000}, commmitValue),
- std::runtime_error);
+ EXPECT_ANY_THROW(sut->commit("Test", Milliseconds{100'000}, commmitValue));
}
class TestLogToRedfishNumeric : public Test, public WithParamInterface<LogParam>
@@ -145,8 +144,7 @@
TEST_P(TestLogToJournalDiscreteThrow, commitAnActionExpectThrow)
{
- EXPECT_THROW(sut->commit("Test", Milliseconds{100'000}, 90.0),
- std::runtime_error);
+ EXPECT_ANY_THROW(sut->commit("Test", Milliseconds{100'000}, 90.0));
}
class TestLogToRedfishDiscrete :