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: If87740ef153661e338448c9de753cbd61fd164eb
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/test/test_health_metric.cpp b/test/test_health_metric.cpp
index 47a840a..067ced0 100644
--- a/test/test_health_metric.cpp
+++ b/test/test_health_metric.cpp
@@ -28,8 +28,8 @@
static constexpr auto busName = "xyz.openbmc_project.test.HealthMon";
const std::set<std::string> properties = {"Value", "MaxValue", "MinValue",
"Unit"};
- const std::string objPath = std::string(PathIntf::value) + "/bmc/" +
- PathIntf::kernel_cpu;
+ const std::string objPath =
+ std::string(PathIntf::value) + "/bmc/" + PathIntf::kernel_cpu;
ConfigIntf::HealthMetric config;
void SetUp() override
@@ -66,26 +66,26 @@
.WillRepeatedly(Invoke(
[&]([[maybe_unused]] sd_bus* bus, [[maybe_unused]] const char* path,
[[maybe_unused]] const char* interface, const char** names) {
- EXPECT_THAT(properties, testing::Contains(names[0]));
- return 0;
- }));
+ EXPECT_THAT(properties, testing::Contains(names[0]));
+ return 0;
+ }));
EXPECT_CALL(sdbusMock, sd_bus_emit_properties_changed_strv(
IsNull(), StrEq(objPath),
StrEq(ThresholdIntf::interface), NotNull()))
.WillRepeatedly(Invoke(
[&]([[maybe_unused]] sd_bus* bus, [[maybe_unused]] const char* path,
[[maybe_unused]] const char* interface, const char** names) {
- EXPECT_THAT(thresholdProperties, testing::Contains(names[0]));
- return 0;
- }));
+ EXPECT_THAT(thresholdProperties, testing::Contains(names[0]));
+ return 0;
+ }));
EXPECT_CALL(sdbusMock,
sd_bus_message_new_signal(_, _, StrEq(objPath),
StrEq(ThresholdIntf::interface),
StrEq("AssertionChanged")))
.Times(4);
- auto metric = std::make_unique<HealthMetric>(bus, Type::cpu, config,
- paths_t());
+ auto metric =
+ std::make_unique<HealthMetric>(bus, Type::cpu, config, paths_t());
// Exceed the critical threshold
metric->update(MValue(1351, 1500));
// Go below critical threshold but above warning threshold
diff --git a/test/test_health_metric_collection.cpp b/test/test_health_metric_collection.cpp
index 7086369..8135eb0 100644
--- a/test/test_health_metric_collection.cpp
+++ b/test/test_health_metric_collection.cpp
@@ -98,16 +98,16 @@
.WillRepeatedly(Invoke(
[&]([[maybe_unused]] sd_bus* bus, [[maybe_unused]] const char* path,
[[maybe_unused]] const char* interface, const char** names) {
- // Test no signal generation for metric init properties
- const std::set<std::string> metricInitProperties = {"MaxValue",
- "MinValue", "Unit"};
- EXPECT_THAT(metricInitProperties,
- testing::Not(testing::Contains(names[0])));
- // Test signal generated for Value property set
- const std::set<std::string> metricSetProperties = {"Value"};
- EXPECT_THAT(metricSetProperties, testing::Contains(names[0]));
- return 0;
- }));
+ // Test no signal generation for metric init properties
+ const std::set<std::string> metricInitProperties = {
+ "MaxValue", "MinValue", "Unit"};
+ EXPECT_THAT(metricInitProperties,
+ testing::Not(testing::Contains(names[0])));
+ // Test signal generated for Value property set
+ const std::set<std::string> metricSetProperties = {"Value"};
+ EXPECT_THAT(metricSetProperties, testing::Contains(names[0]));
+ return 0;
+ }));
EXPECT_CALL(sdbusMock,
sd_bus_emit_properties_changed_strv(
@@ -115,12 +115,12 @@
.WillRepeatedly(Invoke(
[&]([[maybe_unused]] sd_bus* bus, [[maybe_unused]] const char* path,
[[maybe_unused]] const char* interface, const char** names) {
- // Test signal generated for Value property set
- EXPECT_STREQ("Value", names[0]);
- // Test no signal generation for threshold asserted
- EXPECT_STRNE("Asserted", names[0]);
- return 0;
- }));
+ // Test signal generated for Value property set
+ EXPECT_STREQ("Value", names[0]);
+ // Test no signal generation for threshold asserted
+ EXPECT_STRNE("Asserted", names[0]);
+ return 0;
+ }));
createCollection();
}
@@ -138,9 +138,9 @@
.WillRepeatedly(Invoke(
[&]([[maybe_unused]] sd_bus* bus, [[maybe_unused]] const char* path,
[[maybe_unused]] const char* interface, const char** names) {
- EXPECT_THAT("Value", StrEq(names[0]));
- return 0;
- }));
+ EXPECT_THAT("Value", StrEq(names[0]));
+ return 0;
+ }));
// Test threshold asserted property change
EXPECT_CALL(sdbusMock,
@@ -149,11 +149,12 @@
.WillRepeatedly(Invoke(
[&]([[maybe_unused]] sd_bus* bus, [[maybe_unused]] const char* path,
[[maybe_unused]] const char* interface, const char** names) {
- // Test signal generation for threshold properties set
- const std::set<std::string> thresholdProperties = {"Value", "Asserted"};
- EXPECT_THAT(thresholdProperties, testing::Contains(names[0]));
- return 0;
- }));
+ // Test signal generation for threshold properties set
+ const std::set<std::string> thresholdProperties = {"Value",
+ "Asserted"};
+ EXPECT_THAT(thresholdProperties, testing::Contains(names[0]));
+ return 0;
+ }));
// Test AssertionChanged signal generation
EXPECT_CALL(sdbusMock,