handler: Don't hardcode channel information
We can use the functions from the ipmi daemon to get the proper channel
for the named NIC.
Change-Id: I9f479ec90bffed147a68131a6dda5aebd9cfc910
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/test/common.cpp b/test/common.cpp
new file mode 100644
index 0000000..08c3eaa
--- /dev/null
+++ b/test/common.cpp
@@ -0,0 +1,10 @@
+#include <cstdint>
+#include <string>
+
+namespace ipmi
+{
+std::uint8_t getChannelByName(const std::string&)
+{
+ return 1;
+}
+} // namespace ipmi
diff --git a/test/meson.build b/test/meson.build
index 0dc3b49..6630893 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -1,6 +1,19 @@
gtest = dependency('gtest', main: true, disabler: true, required: get_option('tests'))
gmock = dependency('gmock', disabler: true, required: get_option('tests'))
+tests_pre = declare_dependency(
+ dependencies: [sys_dep, gtest, gmock])
+
+tests_lib = static_library(
+ 'common',
+ 'common.cpp',
+ implicit_include_directories: false,
+ dependencies: tests_pre)
+
+tests_dep = declare_dependency(
+ link_with: tests_lib,
+ dependencies: tests_pre)
+
tests = [
'cable',
'cpld',
@@ -21,5 +34,5 @@
t.underscorify(),
t + '_unittest.cpp',
implicit_include_directories: false,
- dependencies: [sys_dep, gtest, gmock]))
+ dependencies: tests_dep))
endforeach