diff options
author | Matt Spinler <spinler@us.ibm.com> | 2019-10-11 15:02:24 -0500 |
---|---|---|
committer | Matt Spinler <spinler@us.ibm.com> | 2019-10-22 09:10:37 -0500 |
commit | ceac9690b410ce99c49dc4b59529456e5eab2322 (patch) | |
tree | 581470ace91ba465ed54e86a867e6e7c7905e78f | |
parent | 213e5c1bf871f509d3aa7691f3f5e559c20fc805 (diff) | |
download | phosphor-logging-ceac9690b410ce99c49dc4b59529456e5eab2322.tar.gz phosphor-logging-ceac9690b410ce99c49dc4b59529456e5eab2322.zip |
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
-rw-r--r-- | test/openpower-pels/real_pel_test.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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 @@ TEST_F(PELTest, RealPELTest) 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); } |