lg2: commit: add stubs to support new sdbusplus events
Create empty stubs for the commit functions from the new event
log design[1].
[1]: https://github.com/openbmc/docs/blob/master/designs/event-logging.md
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I8c0232858f41b875e78d5e41f17c065ca727429d
diff --git a/test/basic_event_commit.cpp b/test/basic_event_commit.cpp
new file mode 100644
index 0000000..fc454d9
--- /dev/null
+++ b/test/basic_event_commit.cpp
@@ -0,0 +1,23 @@
+#include <phosphor-logging/commit.hpp>
+#include <xyz/openbmc_project/Logging/event.hpp>
+
+#include <gtest/gtest.h>
+
+namespace phosphor::logging::test
+{
+
+using LoggingCleared = sdbusplus::event::xyz::openbmc_project::Logging::Cleared;
+
+TEST(TestBasicEventCommit, GenerateSimpleEvent)
+{
+ EXPECT_THROW(
+ { throw LoggingCleared("NUMBER_OF_LOGS", 1); }, LoggingCleared);
+ return;
+}
+
+TEST(TestBasicEventCommit, CallCommit)
+{
+ lg2::commit(LoggingCleared("NUMBER_OF_LOGS", 3));
+}
+
+} // namespace phosphor::logging::test
diff --git a/test/meson.build b/test/meson.build
index 9bf34ed..bdf3cdb 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -24,6 +24,7 @@
endif
tests = [
+ 'basic_event_commit',
'extensions_test',
'remote_logging_test_address',
'remote_logging_test_config',
@@ -45,6 +46,7 @@
gmock_dep,
gtest_dep,
log_manager_deps,
+ pdi_dep,
phosphor_logging_dep,
],
include_directories: include_directories('..', '../gen'),