From 422046de8e2b62255ff3dd6bc3cdae38ba487c62 Mon Sep 17 00:00:00 2001 From: Owen Arnold <owen.arnold@stfc.ac.uk> Date: Sat, 7 Nov 2015 09:10:32 +0000 Subject: [PATCH] refs #14124. clang-format. --- .../test/CreateLogTimeCorrectionTest.h | 3 +- .../test/DetectorEfficiencyVariationTest.h | 3 +- .../Algorithms/test/He3TubeEfficiencyTest.h | 6 ++-- .../Algorithms/test/MedianDetectorTestTest.h | 3 +- Framework/Algorithms/test/SolidAngleTest.h | 3 +- .../Crystal/test/NormaliseVanadiumTest.h | 3 +- .../src/CreateSimulationWorkspace.cpp | 3 +- Framework/DataHandling/src/LoadInstrument.cpp | 6 ++-- Framework/DataHandling/src/LoadSINQFocus.cpp | 3 +- .../DataHandling/test/SaveParameterFileTest.h | 3 +- Framework/DataHandling/test/SaveSPETest.h | 3 +- .../inc/MantidKernel/IPropertyManager.h | 2 -- .../inc/MantidKernel/PropertyWithValue.h | 3 -- Framework/Kernel/src/OptionalBool.cpp | 31 +++++++++---------- Framework/Kernel/test/PropertyManagerTest.h | 12 +++---- Framework/Kernel/test/PropertyWithValueTest.h | 21 ++++++------- .../src/ISISLiveEventDataListener.cpp | 3 +- .../test/ConvertSpiceDataToRealSpaceTest.h | 3 +- .../src/SANSInstrumentCreationHelper.cpp | 3 +- .../src/WorkspaceCreationHelper.cpp | 2 +- 20 files changed, 54 insertions(+), 65 deletions(-) diff --git a/Framework/Algorithms/test/CreateLogTimeCorrectionTest.h b/Framework/Algorithms/test/CreateLogTimeCorrectionTest.h index 4a7784cf664..59b46d98c61 100644 --- a/Framework/Algorithms/test/CreateLogTimeCorrectionTest.h +++ b/Framework/Algorithms/test/CreateLogTimeCorrectionTest.h @@ -178,8 +178,7 @@ private: if (!instrument.empty()) { DataHandling::LoadInstrument load; load.initialize(); - load.setProperty("RewriteSpectraMap", - Mantid::Kernel::OptionalBool(true)); + load.setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(true)); load.setProperty("Workspace", ws); load.setProperty("InstrumentName", instrument); load.execute(); diff --git a/Framework/Algorithms/test/DetectorEfficiencyVariationTest.h b/Framework/Algorithms/test/DetectorEfficiencyVariationTest.h index eb7c739f4a3..cc42ee8bfb4 100644 --- a/Framework/Algorithms/test/DetectorEfficiencyVariationTest.h +++ b/Framework/Algorithms/test/DetectorEfficiencyVariationTest.h @@ -162,8 +162,7 @@ public: std::string inputFile = "INES_Definition.xml"; loader.setPropertyValue("Filename", inputFile); loader.setPropertyValue("Workspace", m_WB1Name); - loader.setProperty("RewriteSpectraMap", - Mantid::Kernel::OptionalBool(true)); + loader.setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(true)); loader.execute(); // both workspaces should use the same instrument information loader.setPropertyValue("Workspace", m_WB2Name); diff --git a/Framework/Algorithms/test/He3TubeEfficiencyTest.h b/Framework/Algorithms/test/He3TubeEfficiencyTest.h index 240ac6c04d8..c6b77145bda 100644 --- a/Framework/Algorithms/test/He3TubeEfficiencyTest.h +++ b/Framework/Algorithms/test/He3TubeEfficiencyTest.h @@ -194,8 +194,7 @@ private: loader.setPropertyValue("Filename", "IDFs_for_UNIT_TESTING/DUM_Definition.xml"); loader.setPropertyValue("Workspace", inputWS); - loader.setProperty("RewriteSpectraMap", - Mantid::Kernel::OptionalBool(true)); + loader.setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(true)); loader.execute(); } @@ -210,8 +209,7 @@ private: loader.setPropertyValue("Filename", "IDFs_for_UNIT_TESTING/DUM_Definition.xml"); loader.setPropertyValue("Workspace", inputEvWS); - loader.setProperty("RewriteSpectraMap", - Mantid::Kernel::OptionalBool(true)); + loader.setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(true)); loader.execute(); } }; diff --git a/Framework/Algorithms/test/MedianDetectorTestTest.h b/Framework/Algorithms/test/MedianDetectorTestTest.h index 0eb37dd5c37..0af30bbfb5d 100644 --- a/Framework/Algorithms/test/MedianDetectorTestTest.h +++ b/Framework/Algorithms/test/MedianDetectorTestTest.h @@ -227,8 +227,7 @@ public: std::string inputFile = "INES_Definition.xml"; loader.setPropertyValue("Filename", inputFile); loader.setPropertyValue("Workspace", m_IWSName); - loader.setProperty("RewriteSpectraMap", - Mantid::Kernel::OptionalBool(true)); + loader.setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(true)); loader.execute(); m_2DWS->getAxis(0)->unit() = UnitFactory::Instance().create("TOF"); diff --git a/Framework/Algorithms/test/SolidAngleTest.h b/Framework/Algorithms/test/SolidAngleTest.h index fb0504a0b8c..80146deb282 100644 --- a/Framework/Algorithms/test/SolidAngleTest.h +++ b/Framework/Algorithms/test/SolidAngleTest.h @@ -58,8 +58,7 @@ public: std::string inputFile = "INES_Definition.xml"; loader.setPropertyValue("Filename", inputFile); loader.setPropertyValue("Workspace", inputSpace); - loader.setProperty("RewriteSpectraMap", - Mantid::Kernel::OptionalBool(true)); + loader.setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(true)); loader.execute(); space2D->getAxis(0)->unit() = UnitFactory::Instance().create("TOF"); diff --git a/Framework/Crystal/test/NormaliseVanadiumTest.h b/Framework/Crystal/test/NormaliseVanadiumTest.h index 1b8874273e4..6baa6967cf2 100644 --- a/Framework/Crystal/test/NormaliseVanadiumTest.h +++ b/Framework/Crystal/test/NormaliseVanadiumTest.h @@ -75,7 +75,8 @@ public: loadInst->setPropertyValue( "Filename", "IDFs_for_UNIT_TESTING/MINITOPAZ_Definition.xml"); loadInst->setProperty<MatrixWorkspace_sptr>("Workspace", retVal); - loadInst->setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(true)); + loadInst->setProperty("RewriteSpectraMap", + Mantid::Kernel::OptionalBool(true)); loadInst->execute(); delete loadInst; // Populate the instrument parameters in this workspace - this works around diff --git a/Framework/DataHandling/src/CreateSimulationWorkspace.cpp b/Framework/DataHandling/src/CreateSimulationWorkspace.cpp index 3029390a0c7..2e0e4f08a5b 100644 --- a/Framework/DataHandling/src/CreateSimulationWorkspace.cpp +++ b/Framework/DataHandling/src/CreateSimulationWorkspace.cpp @@ -104,8 +104,7 @@ void CreateSimulationWorkspace::createInstrument() { } else { loadInstrument->setPropertyValue("InstrumentName", instrProp); } - loadInstrument->setProperty("RewriteSpectraMap", - Kernel::OptionalBool(true)); + loadInstrument->setProperty("RewriteSpectraMap", Kernel::OptionalBool(true)); loadInstrument->executeAsChildAlg(); tempWS = loadInstrument->getProperty("Workspace"); diff --git a/Framework/DataHandling/src/LoadInstrument.cpp b/Framework/DataHandling/src/LoadInstrument.cpp index 688a3ed74ea..b8e71c55013 100644 --- a/Framework/DataHandling/src/LoadInstrument.cpp +++ b/Framework/DataHandling/src/LoadInstrument.cpp @@ -69,8 +69,10 @@ void LoadInstrument::init() { "Name of instrument. Can be used instead of Filename to specify an IDF"); declareProperty("InstrumentXML", "", "The full XML instrument definition as a string."); - declareProperty(new PropertyWithValue<OptionalBool>( - "RewriteSpectraMap", OptionalBool::Unset, boost::make_shared<MandatoryValidator<OptionalBool>>()), + declareProperty( + new PropertyWithValue<OptionalBool>( + "RewriteSpectraMap", OptionalBool::Unset, + boost::make_shared<MandatoryValidator<OptionalBool>>()), "If true then a 1:1 map between the spectrum numbers and " "detector/monitor IDs is set up as follows: the detector/monitor IDs in " "the IDF are ordered from smallest to largest number and then assigned " diff --git a/Framework/DataHandling/src/LoadSINQFocus.cpp b/Framework/DataHandling/src/LoadSINQFocus.cpp index 9a738f66143..1b67cef964c 100644 --- a/Framework/DataHandling/src/LoadSINQFocus.cpp +++ b/Framework/DataHandling/src/LoadSINQFocus.cpp @@ -243,7 +243,8 @@ void LoadSINQFocus::runLoadInstrument() { // different IDF loadInst->setPropertyValue("InstrumentName", m_instrumentName); - loadInst->setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(true)); + loadInst->setProperty("RewriteSpectraMap", + Mantid::Kernel::OptionalBool(true)); loadInst->setProperty<MatrixWorkspace_sptr>("Workspace", m_localWorkspace); loadInst->execute(); } catch (...) { diff --git a/Framework/DataHandling/test/SaveParameterFileTest.h b/Framework/DataHandling/test/SaveParameterFileTest.h index c8834e4f341..29cd23889e5 100644 --- a/Framework/DataHandling/test/SaveParameterFileTest.h +++ b/Framework/DataHandling/test/SaveParameterFileTest.h @@ -177,7 +177,8 @@ public: loaderIDF2.setPropertyValue( "Filename", "IDFs_for_UNIT_TESTING/IDF_for_UNIT_TESTING2.xml"); loaderIDF2.setPropertyValue("Workspace", wsName); - loaderIDF2.setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(true)); + loaderIDF2.setProperty("RewriteSpectraMap", + Mantid::Kernel::OptionalBool(true)); TS_ASSERT_THROWS_NOTHING(loaderIDF2.execute()); TS_ASSERT(loaderIDF2.isExecuted()); diff --git a/Framework/DataHandling/test/SaveSPETest.h b/Framework/DataHandling/test/SaveSPETest.h index 56444359682..b73a8c3d4b9 100644 --- a/Framework/DataHandling/test/SaveSPETest.h +++ b/Framework/DataHandling/test/SaveSPETest.h @@ -181,8 +181,7 @@ private: std::string inputFile = "INES_Definition.xml"; loader.setPropertyValue("Filename", inputFile); loader.setPropertyValue("Workspace", input); - loader.setProperty("RewriteSpectraMap", - Mantid::Kernel::OptionalBool(true)); + loader.setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(true)); loader.execute(); // mask the detector diff --git a/Framework/Kernel/inc/MantidKernel/IPropertyManager.h b/Framework/Kernel/inc/MantidKernel/IPropertyManager.h index 55ae0edf9a2..063daef8c7d 100644 --- a/Framework/Kernel/inc/MantidKernel/IPropertyManager.h +++ b/Framework/Kernel/inc/MantidKernel/IPropertyManager.h @@ -57,7 +57,6 @@ template <typename T> class Matrix; */ class MANTID_KERNEL_DLL IPropertyManager { public: - // IPropertyManager(){} virtual ~IPropertyManager() {} @@ -297,7 +296,6 @@ protected: boost::make_shared<NullValidator>(), "", direction); } - /// Get a property by an index virtual Property *getPointerToPropertyOrdinal(const int &index) const = 0; diff --git a/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h b/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h index 4920b72173c..202b35dd48b 100644 --- a/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h +++ b/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h @@ -161,8 +161,6 @@ void toValue(const std::string &strvalue, std::vector<T> &value) { } } - - template <typename T> void toValue(const std::string &strvalue, std::vector<std::vector<T>> &value, const std::string &outerDelimiter = ",", @@ -256,7 +254,6 @@ template <> inline void addingOperator(OptionalBool &, const OptionalBool &) { "PropertyWithValue.h: += operator not implemented for type bool"); } - template <typename T> inline void addingOperator(boost::shared_ptr<T> &lhs, const boost::shared_ptr<T> &rhs) { diff --git a/Framework/Kernel/src/OptionalBool.cpp b/Framework/Kernel/src/OptionalBool.cpp index 01b3b242ce6..37321c22b4d 100644 --- a/Framework/Kernel/src/OptionalBool.cpp +++ b/Framework/Kernel/src/OptionalBool.cpp @@ -32,7 +32,6 @@ bool OptionalBool::operator==(const OptionalBool &other) const { OptionalBool::Value OptionalBool::getValue() const { return m_arg; } - std::ostream &operator<<(std::ostream &os, OptionalBool const &object) { os << OptionalBool::enumToStrMap()[object.getValue()]; return os; @@ -47,25 +46,25 @@ std::istream &operator>>(std::istream &istream, OptionalBool &object) { return istream; } -const std::string OptionalBool::StrUnset = "Unset"; -const std::string OptionalBool::StrFalse = "False"; -const std::string OptionalBool::StrTrue = "True"; +const std::string OptionalBool::StrUnset = "Unset"; +const std::string OptionalBool::StrFalse = "False"; +const std::string OptionalBool::StrTrue = "True"; std::map<std::string, OptionalBool::Value> OptionalBool::strToEmumMap() { - std::map<std::string, Value> map; - map.insert(std::make_pair(StrUnset, OptionalBool::Unset)); - map.insert(std::make_pair(StrFalse, OptionalBool::False)); - map.insert(std::make_pair(StrTrue, OptionalBool::True)); - return map; + std::map<std::string, Value> map; + map.insert(std::make_pair(StrUnset, OptionalBool::Unset)); + map.insert(std::make_pair(StrFalse, OptionalBool::False)); + map.insert(std::make_pair(StrTrue, OptionalBool::True)); + return map; } -std::map<OptionalBool::Value, std::string> OptionalBool::enumToStrMap(){ - std::map<Value, std::string> map; - auto opposite = strToEmumMap(); - for(auto it = opposite.begin(); it != opposite.end(); ++it){ - map.insert(std::make_pair(it->second, it->first)); - } - return map; +std::map<OptionalBool::Value, std::string> OptionalBool::enumToStrMap() { + std::map<Value, std::string> map; + auto opposite = strToEmumMap(); + for (auto it = opposite.begin(); it != opposite.end(); ++it) { + map.insert(std::make_pair(it->second, it->first)); + } + return map; } } // namespace Kernel diff --git a/Framework/Kernel/test/PropertyManagerTest.h b/Framework/Kernel/test/PropertyManagerTest.h index 0ce994d6339..1ebe7e0f8bc 100644 --- a/Framework/Kernel/test/PropertyManagerTest.h +++ b/Framework/Kernel/test/PropertyManagerTest.h @@ -409,13 +409,13 @@ public: TS_ASSERT_EQUALS(i, 655); } - void test_char_array(){ - PropertyManagerHelper mgr; - - auto nonEmptyString = boost::make_shared<MandatoryValidator<std::string>>(); - mgr.declareProperty("SampleChemicalFormula", "", - "Chemical composition of the sample material", nonEmptyString, Direction::Input); + void test_char_array() { + PropertyManagerHelper mgr; + auto nonEmptyString = boost::make_shared<MandatoryValidator<std::string>>(); + mgr.declareProperty("SampleChemicalFormula", "", + "Chemical composition of the sample material", + nonEmptyString, Direction::Input); } private: diff --git a/Framework/Kernel/test/PropertyWithValueTest.h b/Framework/Kernel/test/PropertyWithValueTest.h index fb64f39c33a..a87009010a7 100644 --- a/Framework/Kernel/test/PropertyWithValueTest.h +++ b/Framework/Kernel/test/PropertyWithValueTest.h @@ -666,21 +666,20 @@ public: TS_ASSERT_EQUALS(value, "World"); } - void test_optional_bool_propert_made_from_optional_bool(){ - OptionalBool inputValue(OptionalBool::False); - PropertyWithValue<OptionalBool> prop("bool_property", inputValue); - OptionalBool heldValue = prop(); - TS_ASSERT_EQUALS(heldValue, inputValue); + void test_optional_bool_propert_made_from_optional_bool() { + OptionalBool inputValue(OptionalBool::False); + PropertyWithValue<OptionalBool> prop("bool_property", inputValue); + OptionalBool heldValue = prop(); + TS_ASSERT_EQUALS(heldValue, inputValue); } + void test_optional_bool_to_setValue() { - void test_optional_bool_to_setValue(){ - - std::string input = OptionalBool::StrTrue; - - PropertyWithValue<OptionalBool> property("myproperty", OptionalBool::Unset, Direction::Input); - property.setValue(input); + std::string input = OptionalBool::StrTrue; + PropertyWithValue<OptionalBool> property("myproperty", OptionalBool::Unset, + Direction::Input); + property.setValue(input); } private: diff --git a/Framework/LiveData/src/ISISLiveEventDataListener.cpp b/Framework/LiveData/src/ISISLiveEventDataListener.cpp index 23490311bce..e18ca7752a4 100644 --- a/Framework/LiveData/src/ISISLiveEventDataListener.cpp +++ b/Framework/LiveData/src/ISISLiveEventDataListener.cpp @@ -428,8 +428,7 @@ void ISISLiveEventDataListener::loadInstrument(const std::string &instrName) { alg->initialize(); alg->setPropertyValue("InstrumentName", instrName); alg->setProperty("Workspace", m_eventBuffer[0]); - alg->setProperty("RewriteSpectraMap", - Mantid::Kernel::OptionalBool(false)); + alg->setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(false)); alg->setChild(true); alg->execute(); // check if the instrument was loaded diff --git a/Framework/MDAlgorithms/test/ConvertSpiceDataToRealSpaceTest.h b/Framework/MDAlgorithms/test/ConvertSpiceDataToRealSpaceTest.h index d3c72ecc752..86e128c1e81 100644 --- a/Framework/MDAlgorithms/test/ConvertSpiceDataToRealSpaceTest.h +++ b/Framework/MDAlgorithms/test/ConvertSpiceDataToRealSpaceTest.h @@ -56,8 +56,7 @@ public: loader.setProperty("InstrumentName", "HB2A"); loader.setProperty("Workspace", dataws); - loader.setProperty("RewriteSpectraMap", - Mantid::Kernel::OptionalBool(true)); + loader.setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(true)); loader.execute(); TS_ASSERT(loader.isExecuted()); diff --git a/Framework/TestHelpers/src/SANSInstrumentCreationHelper.cpp b/Framework/TestHelpers/src/SANSInstrumentCreationHelper.cpp index 82833cbb0f4..cf5abbb548b 100644 --- a/Framework/TestHelpers/src/SANSInstrumentCreationHelper.cpp +++ b/Framework/TestHelpers/src/SANSInstrumentCreationHelper.cpp @@ -75,7 +75,8 @@ void SANSInstrumentCreationHelper::runLoadInstrument( loadInst.setPropertyValue("Filename", "IDFs_for_UNIT_TESTING/" + instrumentID + "_Definition.xml"); loadInst.setProperty<MatrixWorkspace_sptr>("Workspace", workspace); - loadInst.setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(false)); + loadInst.setProperty("RewriteSpectraMap", + Mantid::Kernel::OptionalBool(false)); loadInst.execute(); } diff --git a/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp b/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp index 491c3c438bd..280e754a25b 100644 --- a/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp +++ b/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp @@ -1055,7 +1055,7 @@ createEventWorkspace3(Mantid::DataObjects::EventWorkspace_const_sptr sourceWS, sourceWS->getInstrument()->getName()); loadInst->setProperty<MatrixWorkspace_sptr>("Workspace", outputWS); loadInst->setProperty("RewriteSpectraMap", - Mantid::Kernel::OptionalBool(true)); + Mantid::Kernel::OptionalBool(true)); loadInst->executeAsChildAlg(); // Populate the instrument parameters in this workspace - this works around a // bug -- GitLab