clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: I21d2ca8065f24fd73509229c517f5caf48934b60
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/test/openpower-pels/pel_test.cpp b/test/openpower-pels/pel_test.cpp
index cf54e9c..8369b05 100644
--- a/test/openpower-pels/pel_test.cpp
+++ b/test/openpower-pels/pel_test.cpp
@@ -211,9 +211,10 @@
// in the registry, so the constructor should set them.
regEntry.actionFlags = std::nullopt;
- PEL pel2{
- regEntry, 42, timestamp, phosphor::logging::Entry::Level::Error,
- ad, ffdc, dataIface, journal};
+ PEL pel2{regEntry, 42,
+ timestamp, phosphor::logging::Entry::Level::Error,
+ ad, ffdc,
+ dataIface, journal};
EXPECT_EQ(pel2.userHeader().actionFlags(), 0xA800);
}
@@ -251,11 +252,11 @@
// Make sure that there are still 2 UD sections.
const auto& optSections = pel.optionalSections();
- auto udCount = std::count_if(optSections.begin(), optSections.end(),
- [](const auto& section) {
- return section->header().id ==
- static_cast<uint16_t>(SectionID::userData);
- });
+ auto udCount = std::count_if(
+ optSections.begin(), optSections.end(), [](const auto& section) {
+ return section->header().id ==
+ static_cast<uint16_t>(SectionID::userData);
+ });
EXPECT_EQ(udCount, 2); // AD section and sysInfo section
}
@@ -266,15 +267,15 @@
{
auto data = pelDataFactory(TestPELType::pelSimple);
- std::vector<uint8_t> section1{0x58, 0x58, // ID 'XX'
- 0x00, 0x18, // Size
- 0x01, 0x02, // version, subtype
- 0x03, 0x04, // comp ID
+ std::vector<uint8_t> section1{
+ 0x58, 0x58, // ID 'XX'
+ 0x00, 0x18, // Size
+ 0x01, 0x02, // version, subtype
+ 0x03, 0x04, // comp ID
- // some data
- 0x20, 0x30, 0x05, 0x09, 0x11, 0x1E, 0x1, 0x63,
- 0x20, 0x31, 0x06, 0x0F, 0x09, 0x22, 0x3A,
- 0x00};
+ // some data
+ 0x20, 0x30, 0x05, 0x09, 0x11, 0x1E, 0x1, 0x63, 0x20, 0x31, 0x06, 0x0F,
+ 0x09, 0x22, 0x3A, 0x00};
std::vector<uint8_t> section2{
0x59, 0x59, // ID 'YY'
@@ -848,10 +849,10 @@
.WillOnce(Return(std::vector<std::string>{
"/xyz/openbmc_project/inventory/chassis/motherboard/cpu0"}));
- EXPECT_CALL(
- dataIface,
- getHWCalloutFields(
- "/xyz/openbmc_project/inventory/chassis/motherboard/cpu0", _, _, _))
+ EXPECT_CALL(dataIface,
+ getHWCalloutFields(
+ "/xyz/openbmc_project/inventory/chassis/motherboard/cpu0",
+ _, _, _))
.WillOnce(DoAll(SetArgReferee<1>("1234567"), SetArgReferee<2>("CCCC"),
SetArgReferee<3>("123456789ABC")));
@@ -868,9 +869,10 @@
AdditionalData ad{data};
- PEL pel{
- regEntry, 42, timestamp, phosphor::logging::Entry::Level::Error,
- ad, ffdc, dataIface, journal};
+ PEL pel{regEntry, 42,
+ timestamp, phosphor::logging::Entry::Level::Error,
+ ad, ffdc,
+ dataIface, journal};
ASSERT_TRUE(pel.primarySRC().value()->callouts());
auto& callouts = pel.primarySRC().value()->callouts()->callouts();
@@ -918,9 +920,10 @@
AdditionalData ad{data};
- PEL pel{
- regEntry, 42, timestamp, phosphor::logging::Entry::Level::Error,
- ad, ffdc, dataIface, journal};
+ PEL pel{regEntry, 42,
+ timestamp, phosphor::logging::Entry::Level::Error,
+ ad, ffdc,
+ dataIface, journal};
// no callouts
EXPECT_FALSE(pel.primarySRC().value()->callouts());
@@ -1157,9 +1160,10 @@
EXPECT_CALL(journal, getMessages("", 5)).WillOnce(Return(msgs));
- PEL pel{
- regEntry, 42, timestamp, phosphor::logging::Entry::Level::Error,
- ad, ffdc, dataIface, journal};
+ PEL pel{regEntry, 42,
+ timestamp, phosphor::logging::Entry::Level::Error,
+ ad, ffdc,
+ dataIface, journal};
// Check the generated UserData section
std::string expected{"test1 test2\ntest3 test4\ntest5 test6\n4\n5\n"};
@@ -1183,9 +1187,10 @@
.WillOnce(
Return(std::vector<std::string>{std::string(20000, 'x')}));
- PEL pel{
- regEntry, 42, timestamp, phosphor::logging::Entry::Level::Error,
- ad, ffdc, dataIface, journal};
+ PEL pel{regEntry, 42,
+ timestamp, phosphor::logging::Entry::Level::Error,
+ ad, ffdc,
+ dataIface, journal};
// Check for 1 fewer sections than in the previous PEL
EXPECT_EQ(pel.privateHeader().sectionCount(), pelSectsWithOneUD - 1);
@@ -1214,9 +1219,10 @@
EXPECT_CALL(journal, getMessages("app2", 4)).WillOnce(Return(app2));
EXPECT_CALL(journal, getMessages("app3", 1)).WillOnce(Return(app3));
- PEL pel{
- regEntry, 42, timestamp, phosphor::logging::Entry::Level::Error,
- ad, ffdc, dataIface, journal};
+ PEL pel{regEntry, 42,
+ timestamp, phosphor::logging::Entry::Level::Error,
+ ad, ffdc,
+ dataIface, journal};
// Two more sections than the 1 extra UD section in the first testcase
ASSERT_EQ(pel.privateHeader().sectionCount(), pelSectsWithOneUD + 2);
@@ -1250,9 +1256,10 @@
.WillOnce(
Return(std::vector<std::string>{std::string(20000, 'x')}));
- PEL pel{
- regEntry, 42, timestamp, phosphor::logging::Entry::Level::Error,
- ad, ffdc, dataIface, journal};
+ PEL pel{regEntry, 42,
+ timestamp, phosphor::logging::Entry::Level::Error,
+ ad, ffdc,
+ dataIface, journal};
// The last section should have been dropped, so same as first TC
ASSERT_EQ(pel.privateHeader().sectionCount(), pelSectsWithOneUD);