From e4dfd2f36ff76bf1a20d4929dc1cd683eaf04f0c Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Fri, 19 Jan 2024 23:20:49 +0100 Subject: [PATCH] Fix formatting in tests (#12559) --- Framework/Core/test/test_Expressions.cxx | 2 +- Framework/Core/test/test_ExternalFairMQDeviceWorkflow.cxx | 2 +- Framework/Core/test/test_FrameworkDataFlowToO2Control.cxx | 2 +- Framework/Core/test/test_O2DatabasePDG.cxx | 2 +- Framework/Core/test/test_Parallel.cxx | 6 +++--- Framework/Core/test/test_Root2ArrowTable.cxx | 5 ++--- Framework/Core/test/test_Services.cxx | 2 +- Framework/Core/test/test_StaggeringWorkflow.cxx | 2 +- Framework/Core/test/test_TableBuilder.cxx | 4 ++-- Framework/Core/test/test_TreeToTable.cxx | 2 +- .../Core/test/test_VariablePayloadSequenceWorkflow.cxx | 2 +- 11 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Framework/Core/test/test_Expressions.cxx b/Framework/Core/test/test_Expressions.cxx index 0bd4fdc564946..176db6a259a7c 100644 --- a/Framework/Core/test/test_Expressions.cxx +++ b/Framework/Core/test/test_Expressions.cxx @@ -32,7 +32,7 @@ static BindingNode testInt{"testInt", 6, atype::INT32}; namespace o2::aod::track { -DECLARE_SOA_EXPRESSION_COLUMN(Pze, pz, float, o2::aod::track::tgl*(1.f / o2::aod::track::signed1Pt)); +DECLARE_SOA_EXPRESSION_COLUMN(Pze, pz, float, o2::aod::track::tgl * (1.f / o2::aod::track::signed1Pt)); } // namespace o2::aod::track TEST_CASE("TestTreeParsing") diff --git a/Framework/Core/test/test_ExternalFairMQDeviceWorkflow.cxx b/Framework/Core/test/test_ExternalFairMQDeviceWorkflow.cxx index 249e7fc304949..d4d204f206e0a 100644 --- a/Framework/Core/test/test_ExternalFairMQDeviceWorkflow.cxx +++ b/Framework/Core/test/test_ExternalFairMQDeviceWorkflow.cxx @@ -403,7 +403,7 @@ std::vector defineDataProcessing(ConfigContext const& config) output.AddPart(std::move(inputs.At(msgidx))); } } - auto &messageContext = services.get(); + auto& messageContext = services.get(); o2::framework::sendOnChannel(*device, output, channelName, (size_t)-1); messageContext.fakeDispatch(); return output.Size() != 0; diff --git a/Framework/Core/test/test_FrameworkDataFlowToO2Control.cxx b/Framework/Core/test/test_FrameworkDataFlowToO2Control.cxx index 7b0ffa462a9db..d15eebd26bdf7 100644 --- a/Framework/Core/test/test_FrameworkDataFlowToO2Control.cxx +++ b/Framework/Core/test/test_FrameworkDataFlowToO2Control.cxx @@ -31,7 +31,7 @@ namespace { WorkflowSpec defineDataProcessing() { - return {{.name = "A", // + return {{.name = "A", // .outputs = Outputs{OutputSpec{"TST", "A1"}, OutputSpec{"TST", "A2"}}, // A1 will be consumed twice, A2 is dangling .algorithm = AlgorithmSpec{}, // .options = {ConfigParamSpec{"channel-config", VariantType::String, // raw input channel diff --git a/Framework/Core/test/test_O2DatabasePDG.cxx b/Framework/Core/test/test_O2DatabasePDG.cxx index c6f6f3c9c57e7..11b07d1473390 100644 --- a/Framework/Core/test/test_O2DatabasePDG.cxx +++ b/Framework/Core/test/test_O2DatabasePDG.cxx @@ -40,7 +40,7 @@ struct PdgTest { TParticlePDG* p = pdgOld->GetParticle(300553); ASSERT_ERROR(p != nullptr); ASSERT_ERROR(p->Mass() == 10.580); - ASSERT_ERROR(p->Stable() == kFALSE); + ASSERT_ERROR(p->Stable() == kFALSE); ASSERT_ERROR(p->Charge() == 0); ASSERT_ERROR(p->Width() == 0.000); diff --git a/Framework/Core/test/test_Parallel.cxx b/Framework/Core/test/test_Parallel.cxx index 4fe0c920426e2..7967f55a7b93d 100644 --- a/Framework/Core/test/test_Parallel.cxx +++ b/Framework/Core/test/test_Parallel.cxx @@ -57,7 +57,7 @@ std::vector defineDataProcessing(ConfigContext const&) Outputs{ {"TPC", "CLUSTERS_P", 0, Lifetime::Timeframe}}, AlgorithmSpec{ - //CLion says it ambiguous without (AlgorithmSpec::ProcessCallback), but cmake compiles fine anyway. + // CLion says it ambiguous without (AlgorithmSpec::ProcessCallback), but cmake compiles fine anyway. (AlgorithmSpec::ProcessCallback)someProcessingStageAlgorithm}}, parallelSize, [](DataProcessorSpec& spec, size_t index) { @@ -95,7 +95,7 @@ std::vector defineDataProcessing(ConfigContext const&) auto matcher = DataSpecUtils::asConcreteDataMatcher(*inputSpec); o2::header::DataDescription outputDescription = matcher.description; - //todo: better sampled data flagging + // todo: better sampled data flagging size_t len = strlen(outputDescription.str); if (len < outputDescription.size - 2) { outputDescription.str[len] = '_'; @@ -113,7 +113,7 @@ std::vector defineDataProcessing(ConfigContext const&) const auto* inputHeader = DataRefUtils::getHeader(input); auto& output = ctx.outputs().make(description, inputHeader->size()); - //todo: use some std function or adopt(), when it is available for POD data + // todo: use some std function or adopt(), when it is available for POD data const char* input_ptr = input.payload; for (char& it : output) { it = *input_ptr++; diff --git a/Framework/Core/test/test_Root2ArrowTable.cxx b/Framework/Core/test/test_Root2ArrowTable.cxx index a3f48957d7044..109d9718f5f09 100644 --- a/Framework/Core/test/test_Root2ArrowTable.cxx +++ b/Framework/Core/test/test_Root2ArrowTable.cxx @@ -45,7 +45,7 @@ TEST_CASE("RootTree2Table") t1.Branch("ev", &ev, "ev/I"); t1.Branch("xyz", xyz, "xyz[3]/F"); t1.Branch("ij", ij, "ij[2]/I"); - //fill the tree + // fill the tree for (Int_t i = 0; i < 1000; i++) { xyz[0] = 1; xyz[1] = 2; @@ -91,7 +91,6 @@ TEST_CASE("RootTree2Table") REQUIRE(array->length() == 3000); const float* c = reinterpret_cast(array->values()->data()); - CHECK(c[0] == 1); CHECK(c[1] == 2); CHECK(c[2] == 1); @@ -146,7 +145,7 @@ TEST_CASE("RootTree2TableViaASoA") t2.Branch("ev", &ev, "ev/I"); t2.Branch("xyz", xyz, "xyz[3]/F"); t2.Branch("ij", ij, "ij[2]/I"); - //fill the tree + // fill the tree for (Int_t i = 0; i < 1000; i++) { gRandom->Rannor(xyz[0], xyz[1]); gRandom->Rannor(px, py); diff --git a/Framework/Core/test/test_Services.cxx b/Framework/Core/test/test_Services.cxx index d1a8a3592cd10..23092127fb37b 100644 --- a/Framework/Core/test/test_Services.cxx +++ b/Framework/Core/test/test_Services.cxx @@ -94,7 +94,7 @@ static ServiceRegistry::Salt salt_1 = ServiceRegistry::Salt{1, 0}; static ServiceRegistry::Salt salt_2 = ServiceRegistry::Salt{2, 0}; static ServiceRegistry::Salt salt_3 = ServiceRegistry::Salt{3, 0}; static ServiceRegistry::Salt salt_1_1 = ServiceRegistry::Salt{1, 1}; -} +} // namespace o2::framework TEST_CASE("TestSerialServices") { diff --git a/Framework/Core/test/test_StaggeringWorkflow.cxx b/Framework/Core/test/test_StaggeringWorkflow.cxx index 590ce83cef467..cef3ec90c2042 100644 --- a/Framework/Core/test/test_StaggeringWorkflow.cxx +++ b/Framework/Core/test/test_StaggeringWorkflow.cxx @@ -53,7 +53,7 @@ void customize(std::vector& policies) // search for spec names starting with "processor" return spec.name.find("processor") == 0; }, - [](auto const&, auto const&, auto &) { return o2::framework::CompletionPolicy::CompletionOp::Consume; }}); + [](auto const&, auto const&, auto&) { return o2::framework::CompletionPolicy::CompletionOp::Consume; }}); } #include "Framework/runDataProcessing.h" diff --git a/Framework/Core/test/test_TableBuilder.cxx b/Framework/Core/test/test_TableBuilder.cxx index 26a0f5a930b73..1035a0e0008b2 100644 --- a/Framework/Core/test/test_TableBuilder.cxx +++ b/Framework/Core/test/test_TableBuilder.cxx @@ -32,7 +32,7 @@ namespace test2 DECLARE_SOA_COLUMN_FULL(X, x, uint64_t, "x"); DECLARE_SOA_COLUMN_FULL(Y, y, uint64_t, "y"); DECLARE_SOA_COLUMN_FULL(Pos, pos, int[4], "pos"); -} // namespace test +} // namespace test2 using TestTable = o2::soa::Table; using ArrayTable = o2::soa::Table; @@ -295,7 +295,7 @@ TEST_CASE("TestColumnCount") TEST_CASE("TestMakeFields") { - auto fields = TableBuilderHelpers::makeFields({ "i", "f" }); + auto fields = TableBuilderHelpers::makeFields({"i", "f"}); REQUIRE(fields.size() == 2); REQUIRE(fields[0]->name() == "i"); REQUIRE(fields[1]->name() == "f"); diff --git a/Framework/Core/test/test_TreeToTable.cxx b/Framework/Core/test/test_TreeToTable.cxx index 65569b72b9f35..4746eead57c1e 100644 --- a/Framework/Core/test/test_TreeToTable.cxx +++ b/Framework/Core/test/test_TreeToTable.cxx @@ -53,7 +53,7 @@ TEST_CASE("TreeToTableConversion") t1.Branch("xyzw", xyzw, "xyzw[96]/F"); t1.Branch("small", &b, "small/b"); - //fill the tree + // fill the tree int ntruein[2] = {0}; for (int i = 0; i < ndp; i++) { ok = (i % 2) == 0; diff --git a/Framework/Core/test/test_VariablePayloadSequenceWorkflow.cxx b/Framework/Core/test/test_VariablePayloadSequenceWorkflow.cxx index 9945eab037780..0df6d626f1b49 100644 --- a/Framework/Core/test/test_VariablePayloadSequenceWorkflow.cxx +++ b/Framework/Core/test/test_VariablePayloadSequenceWorkflow.cxx @@ -56,7 +56,7 @@ namespace test // a header with the information expected in the payload // will be sent on the header stack struct SequenceDesc : public o2::header::BaseHeader { - //static data for this header type/version + // static data for this header type/version static constexpr uint32_t sVersion{1}; static constexpr o2::header::HeaderType sHeaderType{o2::header::String2("SequDesc")}; static constexpr o2::header::SerializationMethod sSerializationMethod{o2::header::gSerializationMethodNone};