From f1f2cfa943d08f270976e42e1f386fd34e723003 Mon Sep 17 00:00:00 2001 From: Andrew Geissler Date: Mon, 21 Nov 2016 15:16:45 -0600 Subject: Base error log namespaces on yaml file path This is another step in the direction of getting us to support the error yaml file as it will be defined in the phosphor-dbus-interfaces repo. Change-Id: Ib437bea920f511bdbf541c3e2653bbf35a83fe92 Signed-off-by: Andrew Geissler --- logging_test.cpp | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'logging_test.cpp') diff --git a/logging_test.cpp b/logging_test.cpp index 6c7d343..55d7d45 100644 --- a/logging_test.cpp +++ b/logging_test.cpp @@ -75,36 +75,36 @@ int main() const char *test_string = "/tmp/test_string/"; try { - elog( - org::freedesktop::DBus::Error::FileNotFound:: + elog( + xyz::openbmc_project::Example::Error::TestErrorOne:: ERRNUM(number), - org::freedesktop::DBus::Error::FileNotFound:: + xyz::openbmc_project::Example::Error::TestErrorOne:: FILE_PATH(test_string), - org::freedesktop::DBus::Error::FileNotFound:: + xyz::openbmc_project::Example::Error::TestErrorOne:: FILE_NAME("elog_test_3.txt")); } - catch (elogException& e) + catch (elogException& e) { std::cout << "elog exception caught: " << e.what() << std::endl; } // Reduce our error namespaces - using namespace org::freedesktop::DBus::Error; + using namespace xyz::openbmc_project::Example::Error; // Now read back and verify our data made it into the journal std::stringstream stream; stream << std::hex << number; - rc = validate_journal(FileNotFound::ERRNUM::str_short, + rc = validate_journal(TestErrorOne::ERRNUM::str_short, std::string(stream.str()).c_str()); if(rc) return(rc); - rc = validate_journal(FileNotFound::FILE_PATH::str_short, + rc = validate_journal(TestErrorOne::FILE_PATH::str_short, test_string); if(rc) return(rc); - rc = validate_journal(FileNotFound::FILE_NAME::str_short, + rc = validate_journal(TestErrorOne::FILE_NAME::str_short, "elog_test_3.txt"); if(rc) return(rc); @@ -113,9 +113,9 @@ int main() number = 0x9876; try { - elog(FileNotFound::ERRNUM(number), - prev_entry(), - FileNotFound::FILE_NAME("elog_test_4.txt")); + elog(TestErrorOne::ERRNUM(number), + prev_entry(), + TestErrorOne::FILE_NAME("elog_test_4.txt")); } catch (elogExceptionBase& e) { @@ -125,18 +125,18 @@ int main() // Now read back and verify our data made it into the journal stream.str(""); stream << std::hex << number; - rc = validate_journal(FileNotFound::ERRNUM::str_short, + rc = validate_journal(TestErrorOne::ERRNUM::str_short, std::string(stream.str()).c_str()); if(rc) return(rc); // This should just be equal to what we put in test 3 - rc = validate_journal(FileNotFound::FILE_PATH::str_short, + rc = validate_journal(TestErrorOne::FILE_PATH::str_short, test_string); if(rc) return(rc); - rc = validate_journal(FileNotFound::FILE_NAME::str_short, + rc = validate_journal(TestErrorOne::FILE_NAME::str_short, "elog_test_4.txt"); if(rc) return(rc); @@ -144,13 +144,13 @@ int main() // Compile fail tests // Simple test to prove we fail to compile due to missing param - //elog(FileNotFound::ERRNUM(1), - // FileNotFound::FILE_PATH("test")); + //elog(TestErrorOne::ERRNUM(1), + // TestErrorOne::FILE_PATH("test")); // Simple test to prove we fail to compile due to invalid param - //elog(FileNotFound::ERRNUM(1), - // FileNotFound::FILE_PATH("test"), - // FileNotFound::FILE_NAME(1)); + //elog(TestErrorOne::ERRNUM(1), + // TestErrorOne::FILE_PATH("test"), + // TestErrorOne::FILE_NAME(1)); return 0; } -- cgit v1.2.3