Update primary SRC field based on callout list
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: I41f3eda5c27b8ec74d6329b8f145181f400547f8
diff --git a/test/test-resolution.cpp b/test/test-resolution.cpp
index e9b2104..35f6307 100644
--- a/test/test-resolution.cpp
+++ b/test/test-resolution.cpp
@@ -65,6 +65,14 @@
l1->resolve(sd1);
l2->resolve(sd2);
+ // Verify the subsystems
+ std::pair<callout::SrcSubsystem, callout::Priority> subsys = {
+ callout::SrcSubsystem::PROCESSOR, callout::Priority::HIGH};
+ EXPECT_EQ(sd1.getSubsys(), subsys);
+
+ subsys = {callout::SrcSubsystem::PROCESSOR, callout::Priority::HIGH};
+ EXPECT_EQ(sd2.getSubsys(), subsys);
+
// Start verifying
nlohmann::json j{};
std::string s{};
@@ -146,6 +154,11 @@
c1->resolve(sd);
+ // Verify the subsystem
+ std::pair<callout::SrcSubsystem, callout::Priority> subsys = {
+ callout::SrcSubsystem::MEMORY, callout::Priority::MED_A};
+ EXPECT_EQ(sd.getSubsys(), subsys);
+
nlohmann::json j{};
std::string s{};
@@ -201,6 +214,11 @@
c2->resolve(sd);
c3->resolve(sd);
+ // Verify the subsystem
+ std::pair<callout::SrcSubsystem, callout::Priority> subsys = {
+ callout::SrcSubsystem::CEC_HARDWARE, callout::Priority::MED_A};
+ EXPECT_EQ(sd.getSubsys(), subsys);
+
// Callout list
j = sd.getCalloutList();
s = R"([
@@ -287,6 +305,11 @@
c2->resolve(sd);
c3->resolve(sd);
+ // Verify the subsystem
+ std::pair<callout::SrcSubsystem, callout::Priority> subsys = {
+ callout::SrcSubsystem::MEMORY, callout::Priority::MED_A};
+ EXPECT_EQ(sd.getSubsys(), subsys);
+
// Callout list
j = sd.getCalloutList();
s = R"([
@@ -358,6 +381,11 @@
c1->resolve(sd);
+ // Verify the subsystem
+ std::pair<callout::SrcSubsystem, callout::Priority> subsys = {
+ callout::SrcSubsystem::CEC_CLOCKS, callout::Priority::HIGH};
+ EXPECT_EQ(sd.getSubsys(), subsys);
+
nlohmann::json j{};
std::string s{};
@@ -399,6 +427,11 @@
c1->resolve(sd);
+ // Verify the subsystem
+ std::pair<callout::SrcSubsystem, callout::Priority> subsys = {
+ callout::SrcSubsystem::OTHERS, callout::Priority::LOW};
+ EXPECT_EQ(sd.getSubsys(), subsys);
+
nlohmann::json j{};
std::string s{};
@@ -438,6 +471,11 @@
c1->resolve(sd);
+ // Verify the subsystem
+ std::pair<callout::SrcSubsystem, callout::Priority> subsys = {
+ callout::SrcSubsystem::CEC_HARDWARE, callout::Priority::MED};
+ EXPECT_EQ(sd.getSubsys(), subsys);
+
nlohmann::json j{};
std::string s{};