summaryrefslogtreecommitdiffstats
path: root/test/openpower-pels/pel_test.cpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2020-01-22 14:10:04 -0600
committerMatt Spinler <spinler@us.ibm.com>2020-01-31 15:00:11 +0000
commitf1b46ff4a5db819f36888259d14364006e2b54da (patch)
tree1372214a749b9c29e57a5489474d9242bb28afa0 /test/openpower-pels/pel_test.cpp
parent9694ba6295ad961c4b95e93b26f46dc98bd5b048 (diff)
downloadphosphor-logging-f1b46ff4a5db819f36888259d14364006e2b54da.tar.gz
phosphor-logging-f1b46ff4a5db819f36888259d14364006e2b54da.zip
PEL: Add function to get PEL size
Add a size() function to the PEL class that adds up the size fields in the header of every PEL section. This required a fix to some testcases where the size field was wrong in a header. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I0d70deae116cd3835f2c0ab34e13811da471fb14
Diffstat (limited to 'test/openpower-pels/pel_test.cpp')
-rw-r--r--test/openpower-pels/pel_test.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/openpower-pels/pel_test.cpp b/test/openpower-pels/pel_test.cpp
index afab5ca..995f780 100644
--- a/test/openpower-pels/pel_test.cpp
+++ b/test/openpower-pels/pel_test.cpp
@@ -34,7 +34,6 @@ class PELTest : public CleanLogID
TEST_F(PELTest, FlattenTest)
{
auto data = pelDataFactory(TestPELType::pelSimple);
- auto origData = data;
auto pel = std::make_unique<PEL>(data);
// Check a few fields
@@ -46,7 +45,8 @@ TEST_F(PELTest, FlattenTest)
// Test that data in == data out
auto flattenedData = pel->data();
- ASSERT_EQ(origData, flattenedData);
+ EXPECT_EQ(data, flattenedData);
+ EXPECT_EQ(flattenedData.size(), pel->size());
}
TEST_F(PELTest, CommitTimeTest)
@@ -58,12 +58,12 @@ TEST_F(PELTest, CommitTimeTest)
pel->setCommitTime();
auto newTime = pel->commitTime();
- ASSERT_NE(origTime, newTime);
+ EXPECT_NE(origTime, newTime);
// Make a new PEL and check new value is still there
auto newData = pel->data();
auto newPel = std::make_unique<PEL>(newData);
- ASSERT_EQ(newTime, newPel->commitTime());
+ EXPECT_EQ(newTime, newPel->commitTime());
}
TEST_F(PELTest, AssignIDTest)
@@ -75,12 +75,12 @@ TEST_F(PELTest, AssignIDTest)
pel->assignID();
auto newID = pel->id();
- ASSERT_NE(origID, newID);
+ EXPECT_NE(origID, newID);
// Make a new PEL and check new value is still there
auto newData = pel->data();
auto newPel = std::make_unique<PEL>(newData);
- ASSERT_EQ(newID, newPel->id());
+ EXPECT_EQ(newID, newPel->id());
}
TEST_F(PELTest, WithLogIDTest)
OpenPOWER on IntegriCloud