created Callout classes for various PEL callouts
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: Ia36c52281ebd425ab1c38be57ff35ea19ee01740
diff --git a/test/meson.build b/test/meson.build
index 764ab9a..676c518 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -8,6 +8,7 @@
tests = [
'hello-world',
'bin_stream_test',
+ 'service_data_test',
]
gtest = dependency('gtest', main : true, required : false, method : 'system')
diff --git a/test/service_data_test.cpp b/test/service_data_test.cpp
new file mode 100644
index 0000000..4f8505e
--- /dev/null
+++ b/test/service_data_test.cpp
@@ -0,0 +1,38 @@
+#include <stdio.h>
+
+#include <analyzer/service_data.hpp>
+
+#include "gtest/gtest.h"
+
+using namespace analyzer;
+
+TEST(SericeData, TestSet1)
+{
+ HardwareCallout c1{"Test location 1", Callout::Priority::HIGH};
+ HardwareCallout c2{"Test location 2", Callout::Priority::MED_A};
+ ProcedureCallout c3{ProcedureCallout::NEXTLVL, Callout::Priority::LOW};
+
+ nlohmann::json j{};
+
+ c1.getJson(j);
+ c2.getJson(j);
+ c3.getJson(j);
+
+ // Create a RAW string containing what we should expect in the JSON output.
+ std::string s = R"([
+ {
+ "LocationCode": "Test location 1",
+ "Priority": "H"
+ },
+ {
+ "LocationCode": "Test location 2",
+ "Priority": "A"
+ },
+ {
+ "Priority": "L",
+ "Procedure": "NEXTLVL"
+ }
+])";
+
+ ASSERT_EQ(s, j.dump(4));
+}