PEL: On remove() call, return the removed LogID

Have Repository::remove(const LogID& id), which is used to remove
a PEL, return the full LogID of the removed PEL instead of not
returning anything.

That input id only has to have a filled in PEL ID or OpenBMC event log
ID field, but not both, so returning the full LogID of the removed PEL
ensure the calling code will have both values.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: If869c59acd59563db137d7c9523210539b51a040
diff --git a/test/openpower-pels/repository_test.cpp b/test/openpower-pels/repository_test.cpp
index 3fa2290..4bc3282 100644
--- a/test/openpower-pels/repository_test.cpp
+++ b/test/openpower-pels/repository_test.cpp
@@ -87,6 +87,33 @@
     EXPECT_EQ(*newData, pelData);
 }
 
+TEST_F(RepositoryTest, RemoveTest)
+{
+    using pelID = Repository::LogID::Pel;
+    using obmcID = Repository::LogID::Obmc;
+
+    // Add and remove a PEL from the repo
+
+    Repository repo{repoPath};
+
+    auto data = pelDataFactory(TestPELType::pelSimple);
+    auto pel = std::make_unique<PEL>(data, 1);
+
+    pel->assignID();
+    Repository::LogID id{pelID{pel->id()}, obmcID{pel->obmcLogID()}};
+
+    repo.add(pel);
+
+    auto removedID = repo.remove(id);
+    ASSERT_TRUE(removedID);
+    EXPECT_EQ(*removedID, id);
+
+    EXPECT_FALSE(repo.hasPEL(id));
+
+    // Try to remove it again, not there
+    EXPECT_FALSE(repo.remove(id));
+}
+
 TEST_F(RepositoryTest, RestoreTest)
 {
     using pelID = Repository::LogID::Pel;
@@ -137,6 +164,9 @@
         id.pelID.id = 99;
         id.obmcID.id = 100;
         EXPECT_FALSE(repo.hasPEL(id));
+
+        // Try to remove it anyway
+        EXPECT_FALSE(repo.remove(id));
     }
 
     {