From 53216e676a1148a202d5fc5a65fc6584cb06091f Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Tue, 15 Aug 2023 09:21:35 +0200 Subject: [PATCH] uniform local var names --- GUI/Model/FromCore/ItemizeSimulation.cpp | 12 ++++++------ Tests/Suite/GUI/Check.cpp | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/GUI/Model/FromCore/ItemizeSimulation.cpp b/GUI/Model/FromCore/ItemizeSimulation.cpp index 2149d1dcc0d..0e61282ac64 100644 --- a/GUI/Model/FromCore/ItemizeSimulation.cpp +++ b/GUI/Model/FromCore/ItemizeSimulation.cpp @@ -379,12 +379,12 @@ InstrumentModel* GUI::FromCore::itemizeInstruments(const ISimulation& simulation { InstrumentItem* item; - if (const auto* gisasSimulation = dynamic_cast<const ScatteringSimulation*>(&simulation)) - item = createGISASInstrumentItem(*gisasSimulation); - else if (const auto* offspecSimulation = dynamic_cast<const OffspecSimulation*>(&simulation)) - item = createOffspecInstrumentItem(*offspecSimulation); - else if (const auto* spec_simulation = dynamic_cast<const SpecularSimulation*>(&simulation)) - item = createSpecularInstrumentItem(*spec_simulation); + if (const auto* sim = dynamic_cast<const ScatteringSimulation*>(&simulation)) + item = createGISASInstrumentItem(*sim); + else if (const auto* sim = dynamic_cast<const OffspecSimulation*>(&simulation)) + item = createOffspecInstrumentItem(*sim); + else if (const auto* sim = dynamic_cast<const SpecularSimulation*>(&simulation)) + item = createSpecularInstrumentItem(*sim); else ASSERT_NEVER; diff --git a/Tests/Suite/GUI/Check.cpp b/Tests/Suite/GUI/Check.cpp index f088ff0ac28..98434dfd963 100644 --- a/Tests/Suite/GUI/Check.cpp +++ b/Tests/Suite/GUI/Check.cpp @@ -50,13 +50,14 @@ std::unique_ptr<ISimulation> indirectSimulation(const ISimulation& sim) bool checkSimulation(const std::string& name, ISimulation& sim, const double limit) { std::cout << "Tests/Suite/GUI: " << name << std::endl; - std::cout << " Direct simulation" << std::endl; - const Datafield ref_data = sim.simulate(); std::cout << " Round trip (simulation -> GUI items -> simulation)" << std::endl; std::unique_ptr<ISimulation> sim2(indirectSimulation(sim)); const Datafield data2 = sim2->simulate(); + std::cout << " Direct simulation" << std::endl; + const Datafield ref_data = sim.simulate(); + std::cout << " Check difference" << std::endl; bool ok = DiffUtil::checkRelativeDifference(data2.flatVector(), ref_data.flatVector(), limit); -- GitLab