@@ -155,8 +155,8 @@ TEST_F(ManagerTest, TestCreateWithPEL)
155
155
pelFile.write (reinterpret_cast <const char *>(data.data ()), data.size ());
156
156
pelFile.close ();
157
157
158
- std::string adItem = " RAWPEL= " + pelFilename. string ();
159
- std::vector<std::string> additionalData{adItem };
158
+ std::map<std:: string, std:: string> additionalData{
159
+ { " RAWPEL " , pelFilename. string ()} };
160
160
std::vector<std::string> associations;
161
161
162
162
manager.create (" error message" , 42 , 0 ,
@@ -201,8 +201,8 @@ TEST_F(ManagerTest, TestCreateWithInvalidPEL)
201
201
pelFile.write (reinterpret_cast <const char *>(data.data ()), data.size ());
202
202
pelFile.close ();
203
203
204
- std::string adItem = " RAWPEL= " + pelFilename. string ();
205
- std::vector<std::string> additionalData{adItem };
204
+ std::map<std:: string, std:: string> additionalData{
205
+ { " RAWPEL " , pelFilename. string ()} };
206
206
std::vector<std::string> associations;
207
207
208
208
manager.create (" error message" , 42 , 0 ,
@@ -291,7 +291,7 @@ TEST_F(ManagerTest, TestCreateWithMessageRegistry)
291
291
std::placeholders::_2, std::placeholders::_3),
292
292
std::move (journal)};
293
293
294
- std::vector <std::string> additionalData{" FOO= BAR" };
294
+ std::map <std::string, std::string > additionalData{{ " FOO" , " BAR" } };
295
295
std::vector<std::string> associations;
296
296
297
297
// Create the event log to create the PEL from.
@@ -408,8 +408,8 @@ TEST_F(ManagerTest, TestDBusMethods)
408
408
pelFile.write (reinterpret_cast <const char *>(data.data ()), data.size ());
409
409
pelFile.close ();
410
410
411
- std::string adItem = " RAWPEL= " + pelFilename. string ();
412
- std::vector<std::string> additionalData{adItem };
411
+ std::map<std:: string, std:: string> additionalData{
412
+ { " RAWPEL " , pelFilename. string ()} };
413
413
std::vector<std::string> associations;
414
414
415
415
manager.create (" error message" , 42 , 0 ,
@@ -624,8 +624,7 @@ TEST_F(ManagerTest, TestCreateWithESEL)
624
624
std::move (journal)};
625
625
626
626
{
627
- std::string adItem = " ESEL=" + esel;
628
- std::vector<std::string> additionalData{adItem};
627
+ std::map<std::string, std::string> additionalData{{" ESEL" , esel}};
629
628
std::vector<std::string> associations;
630
629
631
630
manager.create (" error message" , 37 , 0 ,
@@ -639,12 +638,12 @@ TEST_F(ManagerTest, TestCreateWithESEL)
639
638
640
639
// Now an invalid one
641
640
{
642
- std::string adItem = " ESEL= " + esel;
641
+ std::string adItem = esel;
643
642
644
643
// Crop it
645
644
adItem.resize (adItem.size () - 300 );
646
645
647
- std::vector <std::string> additionalData{adItem};
646
+ std::map <std::string, std::string > additionalData{{ " ESEL " , adItem} };
648
647
std::vector<std::string> associations;
649
648
650
649
manager.create (" error message" , 38 , 0 ,
@@ -680,11 +679,11 @@ TEST_F(ManagerTest, TestPruning)
680
679
std::placeholders::_2, std::placeholders::_3),
681
680
std::move (journal)};
682
681
683
- // Create 25 1000B (4096B on disk each, which is what is used for pruning)
684
- // BMC non-informational PELs in the 100KB repository. After the 24th one,
685
- // the repo will be 96% full and a prune should be triggered to remove all
686
- // but 7 to get under 30% full. Then when the 25th is added there will be
687
- // 8 left.
682
+ // Create 25 1000B (4096B on disk each, which is what is used for
683
+ // pruning) BMC non-informational PELs in the 100KB repository. After
684
+ // the 24th one, the repo will be 96% full and a prune should be
685
+ // triggered to remove all but 7 to get under 30% full. Then when the
686
+ // 25th is added there will be 8 left.
688
687
689
688
auto dir = makeTempDir ();
690
689
for (int i = 1 ; i <= 25 ; i++)
@@ -696,8 +695,8 @@ TEST_F(ManagerTest, TestPruning)
696
695
pelFile.write (reinterpret_cast <const char *>(data.data ()), data.size ());
697
696
pelFile.close ();
698
697
699
- std::string adItem = " RAWPEL= " + pelFilename. string ();
700
- std::vector<std::string> additionalData{adItem };
698
+ std::map<std:: string, std:: string> additionalData{
699
+ { " RAWPEL " , pelFilename. string ()} };
701
700
std::vector<std::string> associations;
702
701
703
702
manager.create (" error message" , 42 , 0 ,
@@ -759,8 +758,8 @@ TEST_F(ManagerTest, TestPELManualDelete)
759
758
auto dir = makeTempDir ();
760
759
fs::path pelFilename = dir / " rawpel" ;
761
760
762
- std::string adItem = " RAWPEL= " + pelFilename. string ();
763
- std::vector<std::string> additionalData{adItem };
761
+ std::map<std:: string, std:: string> additionalData{
762
+ { " RAWPEL " , pelFilename. string ()} };
764
763
std::vector<std::string> associations;
765
764
766
765
// Add 20 PELs, they will get incrementing IDs like
@@ -836,8 +835,8 @@ TEST_F(ManagerTest, TestPELManualDeleteAll)
836
835
auto dir = makeTempDir ();
837
836
fs::path pelFilename = dir / " rawpel" ;
838
837
839
- std::string adItem = " RAWPEL= " + pelFilename. string ();
840
- std::vector<std::string> additionalData{adItem };
838
+ std::map<std:: string, std:: string> additionalData{
839
+ { " RAWPEL " , pelFilename. string ()} };
841
840
std::vector<std::string> associations;
842
841
843
842
// Add 200 PELs, they will get incrementing IDs like
@@ -922,8 +921,8 @@ TEST_F(ManagerTest, TestServiceIndicators)
922
921
pelFile.write (reinterpret_cast <const char *>(data.data ()), data.size ());
923
922
pelFile.close ();
924
923
925
- std::string adItem = " RAWPEL= " + pelFilename. string ();
926
- std::vector<std::string> additionalData{adItem };
924
+ std::map<std:: string, std:: string> additionalData{
925
+ { " RAWPEL " , pelFilename. string ()} };
927
926
std::vector<std::string> associations;
928
927
929
928
manager.create (" error message" , 42 , 0 ,
@@ -991,7 +990,7 @@ TEST_F(ManagerTest, TestServiceIndicators)
991
990
registryFile << registry;
992
991
registryFile.close ();
993
992
994
- std::vector< std::string> additionalData;
993
+ std::map<std::string, std::string> additionalData;
995
994
std::vector<std::string> associations;
996
995
997
996
manager.create (" xyz.openbmc_project.Error.Test" , 42 , 0 ,
@@ -1027,8 +1026,8 @@ TEST_F(ManagerTest, TestDuplicatePEL)
1027
1026
pelFile.write (reinterpret_cast <const char *>(data.data ()), data.size ());
1028
1027
pelFile.close ();
1029
1028
1030
- std::string adItem = " RAWPEL= " + pelFilename. string ();
1031
- std::vector<std::string> additionalData{adItem };
1029
+ std::map<std:: string, std:: string> additionalData{
1030
+ { " RAWPEL " , pelFilename. string ()} };
1032
1031
std::vector<std::string> associations;
1033
1032
1034
1033
manager.create (" error message" , 42 , 0 ,
@@ -1052,7 +1051,8 @@ TEST_F(ManagerTest, TestDuplicatePEL)
1052
1051
EXPECT_EQ (count, 1 );
1053
1052
}
1054
1053
1055
- // Test termination bit set for pel with critical system termination severity
1054
+ // Test termination bit set for pel with critical system termination
1055
+ // severity
1056
1056
TEST_F (ManagerTest, TestTerminateBitWithPELSevCriticalSysTerminate)
1057
1057
{
1058
1058
const auto registry = R"(
@@ -1097,7 +1097,7 @@ TEST_F(ManagerTest, TestTerminateBitWithPELSevCriticalSysTerminate)
1097
1097
std::placeholders::_2, std::placeholders::_3),
1098
1098
std::move (journal)};
1099
1099
1100
- std::vector <std::string> additionalData{" FOO= BAR" };
1100
+ std::map <std::string, std::string > additionalData{{ " FOO" , " BAR" } };
1101
1101
std::vector<std::string> associations;
1102
1102
1103
1103
// Create the event log to create the PEL from.
@@ -1200,7 +1200,7 @@ TEST_F(ManagerTest, TestFruPlug)
1200
1200
std::placeholders::_2, std::placeholders::_3),
1201
1201
std::move (journal)};
1202
1202
1203
- std::vector< std::string> additionalData;
1203
+ std::map<std::string, std::string> additionalData;
1204
1204
std::vector<std::string> associations;
1205
1205
1206
1206
auto checkDeconfigured = [](bool deconfigured) {
@@ -1346,7 +1346,7 @@ TEST_F(ManagerTest, TestPELDeleteWithoutHWIsolation)
1346
1346
std::bind (std::mem_fn (&TestLogger::log ), &logger, std::placeholders::_1,
1347
1347
std::placeholders::_2, std::placeholders::_3),
1348
1348
std::move (journal)};
1349
- std::vector< std::string> additionalData;
1349
+ std::map<std::string, std::string> additionalData;
1350
1350
std::vector<std::string> associations;
1351
1351
1352
1352
// Check when there's no PEL with given id.
@@ -1363,8 +1363,8 @@ TEST_F(ManagerTest, TestPELDeleteWithoutHWIsolation)
1363
1363
{
1364
1364
// Verify that the guard flag is false.
1365
1365
EXPECT_FALSE (pel_unguarded.getGuardFlag ());
1366
- // Check that `isDeleteProhibited` returns false when the guard flag is
1367
- // false.
1366
+ // Check that `isDeleteProhibited` returns false when the guard flag
1367
+ // is false.
1368
1368
EXPECT_FALSE (manager.isDeleteProhibited (42 ));
1369
1369
}
1370
1370
manager.erase (42 );
@@ -1449,7 +1449,7 @@ TEST_F(ManagerTest, TestPELDeleteWithHWIsolation)
1449
1449
std::bind (std::mem_fn (&TestLogger::log ), &logger, std::placeholders::_1,
1450
1450
std::placeholders::_2, std::placeholders::_3),
1451
1451
std::move (journal)};
1452
- std::vector< std::string> additionalData;
1452
+ std::map<std::string, std::string> additionalData;
1453
1453
std::vector<std::string> associations;
1454
1454
1455
1455
int fd = createHWIsolatedCalloutFile ();
@@ -1468,9 +1468,9 @@ TEST_F(ManagerTest, TestPELDeleteWithHWIsolation)
1468
1468
auto data = readPELFile (*pelFile);
1469
1469
PEL pel (*data);
1470
1470
EXPECT_TRUE (pel.valid ());
1471
- // Test case where the guard flag is set to true and the hardware isolation
1472
- // guard is associated, which should result in `isDeleteProhibited`
1473
- // returning true as expected.
1471
+ // Test case where the guard flag is set to true and the hardware
1472
+ // isolation guard is associated, which should result in
1473
+ // `isDeleteProhibited` returning true as expected.
1474
1474
EXPECT_TRUE (pel.getGuardFlag ());
1475
1475
EXPECT_TRUE (manager.isDeleteProhibited (42 ));
1476
1476
manager.erase (42 );
0 commit comments