PEL: Enhance the real PEL test
Check the SRC ASCII string, and also check the full ID of the last
section object.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ie5b5ef3783d316a31e370ef898e11ecaf16b9551
diff --git a/test/openpower-pels/real_pel_test.cpp b/test/openpower-pels/real_pel_test.cpp
index 9561079..ec5282d 100644
--- a/test/openpower-pels/real_pel_test.cpp
+++ b/test/openpower-pels/real_pel_test.cpp
@@ -539,12 +539,16 @@
const auto& sections = pel.optionalSections();
EXPECT_EQ(pel.privateHeader()->sectionCount(), sections.size() + 2);
+ auto src = pel.primarySRC();
+ EXPECT_EQ(src.value()->asciiString(), "B181A80E ");
+
// Check that the last section (a 'UD' section) is indeed the last
- // section object by checking the first and last bytes.
+ // section object by checking the ID and the last byte.
auto& last = pel.optionalSections().back();
+ EXPECT_EQ(last->header().id, 0x5544); // "UD"
+
std::vector<uint8_t> lastSectionData;
Stream stream{lastSectionData};
last->flatten(stream);
- EXPECT_EQ(lastSectionData.front(), 'U');
EXPECT_EQ(lastSectionData.back(), 0xA4);
}