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: I8c84201cb2343a8c8a5507a49de0721a1bee7063
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/libpldmresponder/test/libpldmresponder_base_test.cpp b/libpldmresponder/test/libpldmresponder_base_test.cpp
index 0387209..4656882 100644
--- a/libpldmresponder/test/libpldmresponder_base_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_base_test.cpp
@@ -82,8 +82,8 @@
uint8_t retFlag = PLDM_START_AND_END;
ver32_t version = {0x00, 0xF0, 0xF0, 0xF1};
- auto rc = encode_get_version_req(0, transferHandle, flag, pldmType,
- request);
+ auto rc =
+ encode_get_version_req(0, transferHandle, flag, pldmType, request);
ASSERT_EQ(0, rc);
@@ -113,8 +113,8 @@
uint32_t transferHandle = 0x0;
uint8_t flag = PLDM_GET_FIRSTPART;
- auto rc = encode_get_version_req(0, transferHandle, flag, pldmType,
- request);
+ auto rc =
+ encode_get_version_req(0, transferHandle, flag, pldmType, request);
ASSERT_EQ(0, rc);
diff --git a/libpldmresponder/test/libpldmresponder_bios_config_test.cpp b/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
index ea29015..9b4f74e 100644
--- a/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
@@ -98,25 +98,26 @@
EXPECT_TRUE(attrTable);
EXPECT_TRUE(attrValueTable);
- std::set<std::string> expectedStrings = {"HMCManagedState",
- "On",
- "Off",
- "FWBootSide",
- "Perm",
- "Temp",
- "InbandCodeUpdate",
- "Allowed",
- "Allowed",
- "NotAllowed",
- "CodeUpdatePolicy",
- "Concurrent",
- "Disruptive",
- "VDD_AVSBUS_RAIL",
- "SBE_IMAGE_MINIMUM_VALID_ECS",
- "INTEGER_INVALID_CASE",
- "str_example1",
- "str_example2",
- "str_example3"};
+ std::set<std::string> expectedStrings = {
+ "HMCManagedState",
+ "On",
+ "Off",
+ "FWBootSide",
+ "Perm",
+ "Temp",
+ "InbandCodeUpdate",
+ "Allowed",
+ "Allowed",
+ "NotAllowed",
+ "CodeUpdatePolicy",
+ "Concurrent",
+ "Disruptive",
+ "VDD_AVSBUS_RAIL",
+ "SBE_IMAGE_MINIMUM_VALID_ECS",
+ "INTEGER_INVALID_CASE",
+ "str_example1",
+ "str_example2",
+ "str_example3"};
std::set<std::string> strings;
for (auto entry : BIOSTableIter<PLDM_BIOS_STRING_TABLE>(
stringTable->data(), stringTable->size()))
@@ -206,8 +207,8 @@
attrValueTable->data(), attrValueTable->size()))
{
auto header = table::attribute_value::decodeHeader(entry);
- auto attrEntry = table::attribute::findByHandle(*attrTable,
- header.attrHandle);
+ auto attrEntry =
+ table::attribute::findByHandle(*attrTable, header.attrHandle);
auto attrHeader = table::attribute::decodeHeader(attrEntry);
auto attrName = biosStringTable.findString(attrHeader.stringHandle);
auto jsonEntry = findJsonEntry(attrName);
@@ -368,9 +369,8 @@
EXPECT_EQ(rc, PLDM_SUCCESS);
auto attrValueTable = biosConfig.getBIOSTable(PLDM_BIOS_ATTR_VAL_TABLE);
- auto findEntry =
- [&attrValueTable](
- uint16_t handle) -> const pldm_bios_attr_val_table_entry* {
+ auto findEntry = [&attrValueTable](uint16_t handle)
+ -> const pldm_bios_attr_val_table_entry* {
for (auto entry : BIOSTableIter<PLDM_BIOS_ATTR_VAL_TABLE>(
attrValueTable->data(), attrValueTable->size()))
{
diff --git a/libpldmresponder/test/libpldmresponder_fru_test.cpp b/libpldmresponder/test/libpldmresponder_fru_test.cpp
index d654fca..f4a1202 100644
--- a/libpldmresponder/test/libpldmresponder_fru_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_fru_test.cpp
@@ -134,8 +134,8 @@
mockedFruHandler.updateAssociationTree(
objects, "/xyz/openbmc_project/inventory/system/chassis/motherboard");
- pldm_entity_node* node = pldm_entity_association_tree_find(entityTree.get(),
- &systemEntity);
+ pldm_entity_node* node =
+ pldm_entity_association_tree_find(entityTree.get(), &systemEntity);
EXPECT_TRUE(node != NULL);
node = pldm_entity_association_tree_find(entityTree.get(), &chassisEntity);
@@ -143,8 +143,8 @@
test_pldm_entity_node* test_node = (test_pldm_entity_node*)node;
EXPECT_TRUE((test_node->parent).entity_type == systemEntity.entity_type);
- node = pldm_entity_association_tree_find(entityTree.get(),
- &motherboardEntity);
+ node =
+ pldm_entity_association_tree_find(entityTree.get(), &motherboardEntity);
ASSERT_TRUE(node != NULL);
test_node = (test_pldm_entity_node*)node;
EXPECT_TRUE((test_node->parent).entity_type == chassisEntity.entity_type);
diff --git a/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp b/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
index 6ef74b7..87ee867 100644
--- a/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_pdr_effecter_test.cpp
@@ -69,8 +69,8 @@
bf1.byte = 2;
ASSERT_EQ(states->states[0].byte, bf1.byte);
- const auto& [dbusMappings1,
- dbusValMaps1] = handler.getDbusObjMaps(pdr->effecter_id);
+ const auto& [dbusMappings1, dbusValMaps1] =
+ handler.getDbusObjMaps(pdr->effecter_id);
ASSERT_EQ(dbusMappings1[0].objectPath, "/foo/bar");
// Check second PDR
@@ -109,8 +109,8 @@
ASSERT_EQ(states->states[0].byte, bf2[0].byte);
ASSERT_EQ(states->states[1].byte, bf2[1].byte);
- const auto& [dbusMappings2,
- dbusValMaps2] = handler.getDbusObjMaps(pdr->effecter_id);
+ const auto& [dbusMappings2, dbusValMaps2] =
+ handler.getDbusObjMaps(pdr->effecter_id);
ASSERT_EQ(dbusMappings2[0].objectPath, "/foo/bar");
ASSERT_EQ(dbusMappings2[1].objectPath, "/foo/bar");
@@ -157,8 +157,8 @@
EXPECT_EQ(pdr->effecter_id, 3);
EXPECT_EQ(pdr->effecter_data_size, 4);
- const auto& [dbusMappings,
- dbusValMaps] = handler.getDbusObjMaps(pdr->effecter_id);
+ const auto& [dbusMappings, dbusValMaps] =
+ handler.getDbusObjMaps(pdr->effecter_id);
EXPECT_EQ(dbusMappings[0].objectPath, "/foo/bar");
EXPECT_EQ(dbusMappings[0].interface, "xyz.openbmc_project.Foo.Bar");
EXPECT_EQ(dbusMappings[0].propertyName, "propertyName");
diff --git a/libpldmresponder/test/libpldmresponder_platform_test.cpp b/libpldmresponder/test/libpldmresponder_platform_test.cpp
index 63e26e2..d3606f5 100644
--- a/libpldmresponder/test/libpldmresponder_platform_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_platform_test.cpp
@@ -307,15 +307,13 @@
MockdBusHandler, Handler>(mockedUtils, handler, 0x1, stateField);
ASSERT_EQ(rc, PLDM_PLATFORM_SET_EFFECTER_UNSUPPORTED_SENSORSTATE);
- rc = platform_state_effecter::setStateEffecterStatesHandler<MockdBusHandler,
- Handler>(
- mockedUtils, handler, 0x9, stateField);
+ rc = platform_state_effecter::setStateEffecterStatesHandler<
+ MockdBusHandler, Handler>(mockedUtils, handler, 0x9, stateField);
ASSERT_EQ(rc, PLDM_PLATFORM_INVALID_EFFECTER_ID);
stateField.push_back({PLDM_REQUEST_SET, 4});
- rc = platform_state_effecter::setStateEffecterStatesHandler<MockdBusHandler,
- Handler>(
- mockedUtils, handler, 0x1, stateField);
+ rc = platform_state_effecter::setStateEffecterStatesHandler<
+ MockdBusHandler, Handler>(mockedUtils, handler, 0x1, stateField);
ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
pldm_pdr_destroy(inPDRRepo);
@@ -444,18 +442,17 @@
StrEq("xyz.openbmc_project.Foo.Bar")))
.WillOnce(Return(PropertyValue(static_cast<uint64_t>(effecterValue))));
- auto rc = platform_numeric_effecter::getNumericEffecterData<MockdBusHandler,
- Handler>(
- mockedUtils, handler, effecterId, effecterDataSize, propertyType,
- dbusValue);
+ auto rc = platform_numeric_effecter::getNumericEffecterData<
+ MockdBusHandler, Handler>(mockedUtils, handler, effecterId,
+ effecterDataSize, propertyType, dbusValue);
ASSERT_EQ(rc, 0);
- size_t responsePayloadLength = sizeof(completionCode) +
- sizeof(effecterDataSize) +
- sizeof(effecterOperationalState) +
- getEffecterDataSize(effecterDataSize) +
- getEffecterDataSize(effecterDataSize);
+ size_t responsePayloadLength =
+ sizeof(completionCode) + sizeof(effecterDataSize) +
+ sizeof(effecterOperationalState) +
+ getEffecterDataSize(effecterDataSize) +
+ getEffecterDataSize(effecterDataSize);
Response response(responsePayloadLength + sizeof(pldm_msg_hdr));
auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
@@ -511,10 +508,9 @@
pldm::utils::PropertyValue dbusValue;
std::string propertyType;
- auto rc = platform_numeric_effecter::getNumericEffecterData<MockdBusHandler,
- Handler>(
- mockedUtils, handler, effecterId, effecterDataSize, propertyType,
- dbusValue);
+ auto rc = platform_numeric_effecter::getNumericEffecterData<
+ MockdBusHandler, Handler>(mockedUtils, handler, effecterId,
+ effecterDataSize, propertyType, dbusValue);
ASSERT_EQ(rc, 128);
@@ -526,15 +522,15 @@
{
// Sample state sensor with SensorID - 1, EntityType - Processor Module(67)
// State Set ID - Operational Running Status(11), Supported States - 3,4
- std::vector<uint8_t> sample1PDR{0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00,
- 0x00, 0x17, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x43, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x01, 0x0b, 0x00, 0x01, 0x18};
+ std::vector<uint8_t> sample1PDR{
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x17,
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x43, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x0b, 0x00, 0x01, 0x18};
- const auto& [terminusHandle1, sensorID1,
- sensorInfo1] = parseStateSensorPDR(sample1PDR);
- const auto& [containerID1, entityType1,
- entityInstance1] = std::get<0>(sensorInfo1);
+ const auto& [terminusHandle1, sensorID1, sensorInfo1] =
+ parseStateSensorPDR(sample1PDR);
+ const auto& [containerID1, entityType1, entityInstance1] =
+ std::get<0>(sensorInfo1);
const auto& states1 = std::get<1>(sensorInfo1);
CompositeSensorStates statesCmp1{{3u, 4u}};
@@ -547,15 +543,15 @@
// Sample state sensor with SensorID - 2, EntityType - System Firmware(31)
// State Set ID - Availability(2), Supported States - 3,4,9,10,11,13
- std::vector<uint8_t> sample2PDR{0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00,
- 0x00, 0x17, 0x00, 0x00, 0x00, 0x02, 0x00,
- 0x1F, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x01, 0x02, 0x00, 0x02, 0x18, 0x2E};
+ std::vector<uint8_t> sample2PDR{
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x17, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x1F, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x01, 0x02, 0x00, 0x02, 0x18, 0x2E};
- const auto& [terminusHandle2, sensorID2,
- sensorInfo2] = parseStateSensorPDR(sample2PDR);
- const auto& [containerID2, entityType2,
- entityInstance2] = std::get<0>(sensorInfo2);
+ const auto& [terminusHandle2, sensorID2, sensorInfo2] =
+ parseStateSensorPDR(sample2PDR);
+ const auto& [containerID2, entityType2, entityInstance2] =
+ std::get<0>(sensorInfo2);
const auto& states2 = std::get<1>(sensorInfo2);
CompositeSensorStates statesCmp2{{3u, 4u, 9u, 10u, 11u, 13u}};
@@ -575,10 +571,10 @@
0x00, 0x03, 0x00, 0x21, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
0x02, 0x21, 0x00, 0x01, 0x06, 0x0F, 0x00, 0x01, 0x1E};
- const auto& [terminusHandle3, sensorID3,
- sensorInfo3] = parseStateSensorPDR(sample3PDR);
- const auto& [containerID3, entityType3,
- entityInstance3] = std::get<0>(sensorInfo3);
+ const auto& [terminusHandle3, sensorID3, sensorInfo3] =
+ parseStateSensorPDR(sample3PDR);
+ const auto& [containerID3, entityType3, entityInstance3] =
+ std::get<0>(sensorInfo3);
const auto& states3 = std::get<1>(sensorInfo3);
CompositeSensorStates statesCmp3{{1u, 2u}, {1u, 2u, 3u, 4u}};
diff --git a/libpldmresponder/test/libpldmresponder_systemspecific_bios_test.cpp b/libpldmresponder/test/libpldmresponder_systemspecific_bios_test.cpp
index 0c7cc8c..9b7fe8a 100644
--- a/libpldmresponder/test/libpldmresponder_systemspecific_bios_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_systemspecific_bios_test.cpp
@@ -105,25 +105,26 @@
EXPECT_TRUE(attrTable);
EXPECT_TRUE(attrValueTable);
- std::set<std::string> expectedStrings = {"HMCManagedState",
- "On",
- "Off",
- "FWBootSide",
- "Perm",
- "Temp",
- "InbandCodeUpdate",
- "Allowed",
- "Allowed",
- "NotAllowed",
- "CodeUpdatePolicy",
- "Concurrent",
- "Disruptive",
- "VDD_AVSBUS_RAIL",
- "SBE_IMAGE_MINIMUM_VALID_ECS",
- "INTEGER_INVALID_CASE",
- "str_example1",
- "str_example2",
- "str_example3"};
+ std::set<std::string> expectedStrings = {
+ "HMCManagedState",
+ "On",
+ "Off",
+ "FWBootSide",
+ "Perm",
+ "Temp",
+ "InbandCodeUpdate",
+ "Allowed",
+ "Allowed",
+ "NotAllowed",
+ "CodeUpdatePolicy",
+ "Concurrent",
+ "Disruptive",
+ "VDD_AVSBUS_RAIL",
+ "SBE_IMAGE_MINIMUM_VALID_ECS",
+ "INTEGER_INVALID_CASE",
+ "str_example1",
+ "str_example2",
+ "str_example3"};
std::set<std::string> strings;
for (auto entry : BIOSTableIter<PLDM_BIOS_STRING_TABLE>(
stringTable->data(), stringTable->size()))
@@ -213,8 +214,8 @@
attrValueTable->data(), attrValueTable->size()))
{
auto header = table::attribute_value::decodeHeader(entry);
- auto attrEntry = table::attribute::findByHandle(*attrTable,
- header.attrHandle);
+ auto attrEntry =
+ table::attribute::findByHandle(*attrTable, header.attrHandle);
auto attrHeader = table::attribute::decodeHeader(attrEntry);
auto attrName = biosStringTable.findString(attrHeader.stringHandle);
auto jsonEntry = findJsonEntry(attrName);
@@ -453,9 +454,8 @@
EXPECT_EQ(rc, PLDM_SUCCESS);
auto attrValueTable = biosConfig.getBIOSTable(PLDM_BIOS_ATTR_VAL_TABLE);
- auto findEntry =
- [&attrValueTable](
- uint16_t handle) -> const pldm_bios_attr_val_table_entry* {
+ auto findEntry = [&attrValueTable](uint16_t handle)
+ -> const pldm_bios_attr_val_table_entry* {
for (auto entry : BIOSTableIter<PLDM_BIOS_ATTR_VAL_TABLE>(
attrValueTable->data(), attrValueTable->size()))
{