PEL: Refactor the test data factory

This commit has no functional changes, it just does some things
to make the PEL data creator for testcases, pelDataFactory(), be
more manageable:

- Change to return a plain vector instead of a unique_ptr<vector>.
- Keeps the data for each section in separate vectors and then
  either returns those as-is or combines them into a PEL.
- Change the TestPelType enum to TestPELType to match the style guide.
- Have pelDataFactory provide the SRC section instead of srcDataFactory.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I4770aa6a8169e89b6b8f685a9994d845c9e93cfe
diff --git a/test/openpower-pels/pel_test.cpp b/test/openpower-pels/pel_test.cpp
index 56e356f..b744432 100644
--- a/test/openpower-pels/pel_test.cpp
+++ b/test/openpower-pels/pel_test.cpp
@@ -17,9 +17,9 @@
 
 TEST_F(PELTest, FlattenTest)
 {
-    auto data = pelDataFactory(TestPelType::pelSimple);
-    auto origData = *data;
-    auto pel = std::make_unique<PEL>(*data);
+    auto data = pelDataFactory(TestPELType::pelSimple);
+    auto origData = data;
+    auto pel = std::make_unique<PEL>(data);
 
     // Check a few fields
     EXPECT_TRUE(pel->valid());
@@ -35,8 +35,8 @@
 
 TEST_F(PELTest, CommitTimeTest)
 {
-    auto data = pelDataFactory(TestPelType::pelSimple);
-    auto pel = std::make_unique<PEL>(*data);
+    auto data = pelDataFactory(TestPELType::pelSimple);
+    auto pel = std::make_unique<PEL>(data);
 
     auto origTime = pel->commitTime();
     pel->setCommitTime();
@@ -52,8 +52,8 @@
 
 TEST_F(PELTest, AssignIDTest)
 {
-    auto data = pelDataFactory(TestPelType::pelSimple);
-    auto pel = std::make_unique<PEL>(*data);
+    auto data = pelDataFactory(TestPELType::pelSimple);
+    auto pel = std::make_unique<PEL>(data);
 
     auto origID = pel->id();
     pel->assignID();
@@ -69,8 +69,8 @@
 
 TEST_F(PELTest, WithLogIDTest)
 {
-    auto data = pelDataFactory(TestPelType::pelSimple);
-    auto pel = std::make_unique<PEL>(*data, 0x42);
+    auto data = pelDataFactory(TestPELType::pelSimple);
+    auto pel = std::make_unique<PEL>(data, 0x42);
 
     EXPECT_TRUE(pel->valid());
     EXPECT_EQ(pel->obmcLogID(), 0x42);
@@ -78,21 +78,21 @@
 
 TEST_F(PELTest, InvalidPELTest)
 {
-    auto data = pelDataFactory(TestPelType::pelSimple);
+    auto data = pelDataFactory(TestPELType::pelSimple);
 
     // Too small
-    data->resize(PrivateHeader::flattenedSize());
+    data.resize(PrivateHeader::flattenedSize());
 
-    auto pel = std::make_unique<PEL>(*data);
+    auto pel = std::make_unique<PEL>(data);
 
     EXPECT_TRUE(pel->privateHeader()->valid());
     EXPECT_FALSE(pel->userHeader()->valid());
     EXPECT_FALSE(pel->valid());
 
     // Now corrupt the private header
-    data = pelDataFactory(TestPelType::pelSimple);
-    data->at(0) = 0;
-    pel = std::make_unique<PEL>(*data);
+    data = pelDataFactory(TestPELType::pelSimple);
+    data.at(0) = 0;
+    pel = std::make_unique<PEL>(data);
 
     EXPECT_FALSE(pel->privateHeader()->valid());
     EXPECT_TRUE(pel->userHeader()->valid());
@@ -131,7 +131,7 @@
 // there aren't explicit classes for.
 TEST_F(PELTest, GenericSectionTest)
 {
-    auto data = pelDataFactory(TestPelType::pelSimple);
+    auto data = pelDataFactory(TestPELType::pelSimple);
 
     std::vector<uint8_t> section1{0x58, 0x58, // ID 'XX'
                                   0x00, 0x18, // Size
@@ -154,14 +154,14 @@
         0x09, 0x22, 0x3A, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
 
     // Add the new sections at the end
-    data->insert(data->end(), section1.begin(), section1.end());
-    data->insert(data->end(), section2.begin(), section2.end());
+    data.insert(data.end(), section1.begin(), section1.end());
+    data.insert(data.end(), section2.begin(), section2.end());
 
     // Increment the section count
-    data->at(27) += 2;
-    auto origData = *data;
+    data.at(27) += 2;
+    auto origData = data;
 
-    PEL pel{*data};
+    PEL pel{data};
 
     const auto& sections = pel.optionalSections();
 
@@ -195,17 +195,17 @@
 // Test that an invalid section will still get a Generic object
 TEST_F(PELTest, InvalidGenericTest)
 {
-    auto data = pelDataFactory(TestPelType::pelSimple);
+    auto data = pelDataFactory(TestPELType::pelSimple);
 
     // Not a valid section
     std::vector<uint8_t> section1{0x01, 0x02, 0x03};
 
-    data->insert(data->end(), section1.begin(), section1.end());
+    data.insert(data.end(), section1.begin(), section1.end());
 
     // Increment the section count
-    data->at(27) += 1;
+    data.at(27) += 1;
 
-    PEL pel{*data};
+    PEL pel{data};
     EXPECT_FALSE(pel.valid());
 
     const auto& sections = pel.optionalSections();