summaryrefslogtreecommitdiffstats
path: root/callouts
diff options
context:
space:
mode:
authorDeepak Kodihalli <dkodihal@in.ibm.com>2017-03-05 23:23:50 -0600
committerPatrick Williams <patrick@stwcx.xyz>2017-03-15 21:11:40 +0000
commit739e925643409e2e9b7750b3cb9f6d873c2be2fe (patch)
tree3f89c38b81048d36d2e5fd332a7a21c379216f92 /callouts
parentd722b3aa03c55f9a9737fb47a68e66ad803f53cc (diff)
downloadphosphor-logging-739e925643409e2e9b7750b3cb9f6d873c2be2fe.tar.gz
phosphor-logging-739e925643409e2e9b7750b3cb9f6d873c2be2fe.zip
test: add callout-test
Add test program which can create callouts based on an input device path. It creates an error, with callouts, with name TestCallout. Change-Id: I96b66b73ae4a9c00daff06222841a13747c07408 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Diffstat (limited to 'callouts')
-rw-r--r--callouts/callout_test.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/callouts/callout_test.cpp b/callouts/callout_test.cpp
new file mode 100644
index 0000000..2af6dc0
--- /dev/null
+++ b/callouts/callout_test.cpp
@@ -0,0 +1,32 @@
+#include <iostream>
+#include <phosphor-logging/elog.hpp>
+#include <phosphor-logging/elog-errors.hpp>
+#include "elog_meta.hpp"
+
+using namespace phosphor::logging;
+
+int main(int argc, char** argv)
+{
+ if(2 != argc)
+ {
+ std::cerr << "usage: callout-test <sysfs path>" << std::endl;
+ return -1;
+ }
+
+ using namespace example::xyz::openbmc_project::Example::Elog;
+ try
+ {
+ elog<TestCallout>(
+ TestCallout::DEV_ADDR(0xDEADEAD),
+ TestCallout::CALLOUT_ERRNO_TEST(0),
+ TestCallout::CALLOUT_DEVICE_PATH_TEST(argv[1]));
+ }
+ catch (elogException<TestCallout>& e)
+ {
+ commit(e.name());
+ }
+
+ return 0;
+}
+
+
OpenPOWER on IntegriCloud