summaryrefslogtreecommitdiffstats
path: root/logging_test.cpp
diff options
context:
space:
mode:
authorDeepak Kodihalli <dkodihal@in.ibm.com>2017-01-20 02:59:22 -0600
committerDeepak Kodihalli <dkodihal@in.ibm.com>2017-01-27 10:43:28 -0600
commitac784ccd09e68fc8d74ed3b308230d61f9c9e12a (patch)
tree0f34f0e9576476d0f6c8d6ee704a1dfc745bd543 /logging_test.cpp
parentf2462f0f7404400b888f47ea21c16a67dd429eb8 (diff)
downloadphosphor-logging-ac784ccd09e68fc8d74ed3b308230d61f9c9e12a.tar.gz
phosphor-logging-ac784ccd09e68fc8d74ed3b308230d61f9c9e12a.zip
Update test case to verify error inheritance
Ensure inherited metadata shows up in the journal. Change-Id: I4b6c30e1439bf6a799fbb78d8e8eb6754141b568 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Diffstat (limited to 'logging_test.cpp')
-rw-r--r--logging_test.cpp38
1 files changed, 34 insertions, 4 deletions
diff --git a/logging_test.cpp b/logging_test.cpp
index 6a5f07f..1920f36 100644
--- a/logging_test.cpp
+++ b/logging_test.cpp
@@ -83,9 +83,9 @@ int main()
example::xyz::openbmc_project::Example::TestErrorOne::
FILE_NAME("elog_test_3.txt"),
example::xyz::openbmc_project::Example::TestErrorTwo::
- DEV_ADDR(0xDEAD),
+ DEV_ADDR(0xDEADDEAD),
example::xyz::openbmc_project::Example::TestErrorTwo::
- DEV_ID(0x100),
+ DEV_ID(100),
example::xyz::openbmc_project::Example::TestErrorTwo::
DEV_NAME("test case 3"));
}
@@ -115,6 +115,21 @@ int main()
if(rc)
return(rc);
+ rc = validate_journal(TestErrorTwo::DEV_ADDR::str_short,
+ "0xDEADDEAD");
+ if(rc)
+ return(rc);
+
+ rc = validate_journal(TestErrorTwo::DEV_ID::str_short,
+ "100");
+ if(rc)
+ return(rc);
+
+ rc = validate_journal(TestErrorTwo::DEV_NAME::str_short,
+ "test case 3");
+ if(rc)
+ return(rc);
+
// TEST 4 - Create error log with previous entry use
number = 0x9876;
try
@@ -122,8 +137,8 @@ int main()
elog<TestErrorOne>(TestErrorOne::ERRNUM(number),
prev_entry<TestErrorOne::FILE_PATH>(),
TestErrorOne::FILE_NAME("elog_test_4.txt"),
- TestErrorTwo::DEV_ADDR(0xDEAD),
- TestErrorTwo::DEV_ID(0x100),
+ TestErrorTwo::DEV_ADDR(0xDEADDEAD),
+ TestErrorTwo::DEV_ID(100),
TestErrorTwo::DEV_NAME("test case 4"));
}
catch (elogExceptionBase& e)
@@ -150,6 +165,21 @@ int main()
if(rc)
return(rc);
+ rc = validate_journal(TestErrorTwo::DEV_ADDR::str_short,
+ "0xDEADDEAD");
+ if(rc)
+ return(rc);
+
+ rc = validate_journal(TestErrorTwo::DEV_ID::str_short,
+ "100");
+ if(rc)
+ return(rc);
+
+ rc = validate_journal(TestErrorTwo::DEV_NAME::str_short,
+ "test case 4");
+ if(rc)
+ return(rc);
+
// Compile fail tests
// Simple test to prove we fail to compile due to missing param
OpenPOWER on IntegriCloud