Commit bfca7296 authored by Samuel Jones's avatar Samuel Jones
Browse files

GCC8 fixes catch exception by refference, no const casting etc

parent 9df9fa71
...@@ -126,7 +126,7 @@ public: ...@@ -126,7 +126,7 @@ public:
auto &algFactory = AlgorithmFactory::Instance(); auto &algFactory = AlgorithmFactory::Instance();
TS_ASSERT_THROWS(algFactory.highestVersion("ToyAlgorithm"), TS_ASSERT_THROWS(algFactory.highestVersion("ToyAlgorithm"),
std::invalid_argument); const std::invalid_argument &);
algFactory.subscribe<ToyAlgorithm>(); algFactory.subscribe<ToyAlgorithm>();
TS_ASSERT_EQUALS(1, algFactory.highestVersion("ToyAlgorithm")); TS_ASSERT_EQUALS(1, algFactory.highestVersion("ToyAlgorithm"));
......
...@@ -111,7 +111,7 @@ public: ...@@ -111,7 +111,7 @@ public:
void testVersionFail() { void testVersionFail() {
const size_t nalgs = AlgorithmFactory::Instance().getKeys().size(); const size_t nalgs = AlgorithmFactory::Instance().getKeys().size();
TS_ASSERT_THROWS(AlgorithmFactory::Instance().subscribe<AlgTestFail>(), TS_ASSERT_THROWS(AlgorithmFactory::Instance().subscribe<AlgTestFail>(),
std::runtime_error); const std::runtime_error &);
// Size should be the same // Size should be the same
TS_ASSERT_EQUALS(AlgorithmFactory::Instance().getKeys().size(), nalgs); TS_ASSERT_EQUALS(AlgorithmFactory::Instance().getKeys().size(), nalgs);
} }
...@@ -124,9 +124,9 @@ public: ...@@ -124,9 +124,9 @@ public:
void testInstance() { void testInstance() {
TS_ASSERT_THROWS_NOTHING(AlgorithmManager::Instance().create("AlgTest")); TS_ASSERT_THROWS_NOTHING(AlgorithmManager::Instance().create("AlgTest"));
TS_ASSERT_THROWS(AlgorithmManager::Instance().create("AlgTest", 3), TS_ASSERT_THROWS(AlgorithmManager::Instance().create("AlgTest", 3),
std::runtime_error); const std::runtime_error &);
TS_ASSERT_THROWS(AlgorithmManager::Instance().create("aaaaaa"), TS_ASSERT_THROWS(AlgorithmManager::Instance().create("aaaaaa"),
std::runtime_error); const std::runtime_error &);
} }
void testClear() { void testClear() {
......
...@@ -142,7 +142,7 @@ public: ...@@ -142,7 +142,7 @@ public:
IAlgorithm_sptr adder = IAlgorithm_sptr adder =
Mantid::API::AlgorithmFactory::Instance().create("SimpleSum", 1); Mantid::API::AlgorithmFactory::Instance().create("SimpleSum", 1);
TS_ASSERT_THROWS(testAlg.setProperty("CalculateStep", adder), TS_ASSERT_THROWS(testAlg.setProperty("CalculateStep", adder),
std::invalid_argument); const std::invalid_argument &);
// Add the required property so now it should pass // Add the required property so now it should pass
adder->initialize(); adder->initialize();
TS_ASSERT_THROWS_NOTHING(testAlg.setProperty("CalculateStep", adder)); TS_ASSERT_THROWS_NOTHING(testAlg.setProperty("CalculateStep", adder));
......
...@@ -293,7 +293,7 @@ public: ...@@ -293,7 +293,7 @@ public:
void testExecute() { void testExecute() {
ToyAlgorithm myAlg; ToyAlgorithm myAlg;
TS_ASSERT_THROWS(myAlg.execute(), std::runtime_error); TS_ASSERT_THROWS(myAlg.execute(), const std::runtime_error &);
TS_ASSERT(!myAlg.isExecuted()); TS_ASSERT(!myAlg.isExecuted());
TS_ASSERT_THROWS_NOTHING(myAlg.initialize()); TS_ASSERT_THROWS_NOTHING(myAlg.initialize());
TS_ASSERT_THROWS_NOTHING(myAlg.execute()); TS_ASSERT_THROWS_NOTHING(myAlg.execute());
...@@ -303,7 +303,7 @@ public: ...@@ -303,7 +303,7 @@ public:
void testSetPropertyValue() { void testSetPropertyValue() {
TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("prop1", "val")) TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("prop1", "val"))
TS_ASSERT_THROWS(alg.setPropertyValue("prop3", "1"), TS_ASSERT_THROWS(alg.setPropertyValue("prop3", "1"),
Exception::NotFoundError) const Exception::NotFoundError &)
} }
void testExistsProperty() { void testExistsProperty() {
...@@ -315,7 +315,8 @@ public: ...@@ -315,7 +315,8 @@ public:
std::string value; std::string value;
TS_ASSERT_THROWS_NOTHING(value = alg.getPropertyValue("prop2")) TS_ASSERT_THROWS_NOTHING(value = alg.getPropertyValue("prop2"))
TS_ASSERT(!value.compare("1")) TS_ASSERT(!value.compare("1"))
TS_ASSERT_THROWS(alg.getPropertyValue("ghjkgh"), Exception::NotFoundError) TS_ASSERT_THROWS(alg.getPropertyValue("ghjkgh"),
const Exception::NotFoundError &)
} }
void testGetProperties() { void testGetProperties() {
...@@ -373,7 +374,7 @@ public: ...@@ -373,7 +374,7 @@ public:
void test_From_String_With_Invalid_Input_Throws() { void test_From_String_With_Invalid_Input_Throws() {
const std::string input = "()"; const std::string input = "()";
TS_ASSERT_THROWS(Algorithm::fromString(input), std::runtime_error); TS_ASSERT_THROWS(Algorithm::fromString(input), const std::runtime_error &);
} }
void test_Construction_Via_Valid_String_With_No_Properties() { void test_Construction_Via_Valid_String_With_No_Properties() {
...@@ -988,11 +989,11 @@ public: ...@@ -988,11 +989,11 @@ public:
TS_ASSERT_THROWS( TS_ASSERT_THROWS(
indexAlg.getWorkspaceAndIndices<MatrixWorkspace>("InputWorkspace2"), indexAlg.getWorkspaceAndIndices<MatrixWorkspace>("InputWorkspace2"),
std::runtime_error); const std::runtime_error &);
TS_ASSERT_THROWS( TS_ASSERT_THROWS(
(indexAlg.setWorkspaceInputProperties<MatrixWorkspace, std::string>( (indexAlg.setWorkspaceInputProperties<MatrixWorkspace, std::string>(
"InputWorkspace2", "wksp", IndexType::SpectrumNum, "1:5")), "InputWorkspace2", "wksp", IndexType::SpectrumNum, "1:5")),
std::runtime_error); const std::runtime_error &);
} }
void testIndexingAlgorithm_failExistingIndexProperty() { void testIndexingAlgorithm_failExistingIndexProperty() {
...@@ -1001,7 +1002,7 @@ public: ...@@ -1001,7 +1002,7 @@ public:
TS_ASSERT_THROWS(indexAlg.declareProperty( TS_ASSERT_THROWS(indexAlg.declareProperty(
make_unique<WorkspaceProperty<MatrixWorkspace>>( make_unique<WorkspaceProperty<MatrixWorkspace>>(
"InputWorkspace", "", Direction::Input)), "InputWorkspace", "", Direction::Input)),
std::runtime_error); const std::runtime_error &);
} }
private: private:
......
...@@ -79,7 +79,7 @@ public: ...@@ -79,7 +79,7 @@ public:
TS_ASSERT_THROWS_NOTHING(ads.retrieve("Z")); TS_ASSERT_THROWS_NOTHING(ads.retrieve("Z"));
ads.remove("Z"); ads.remove("Z");
TS_ASSERT_THROWS(ads.retrieve("z"), Exception::NotFoundError); TS_ASSERT_THROWS(ads.retrieve("z"), const Exception::NotFoundError &);
} }
void test_retrieveWorkspaces_with_empty_list_returns_empty_list() { void test_retrieveWorkspaces_with_empty_list_returns_empty_list() {
...@@ -88,16 +88,17 @@ public: ...@@ -88,16 +88,17 @@ public:
} }
void test_retrieveWorkspaces_with_all_missing_items_throws_exception() { void test_retrieveWorkspaces_with_all_missing_items_throws_exception() {
TS_ASSERT_THROWS(ads.retrieveWorkspaces({"a"}), Exception::NotFoundError); TS_ASSERT_THROWS(ads.retrieveWorkspaces({"a"}),
const Exception::NotFoundError &);
TS_ASSERT_THROWS(ads.retrieveWorkspaces({"a", "b"}), TS_ASSERT_THROWS(ads.retrieveWorkspaces({"a", "b"}),
Exception::NotFoundError); const Exception::NotFoundError &);
} }
void test_retrieveWorkspaces_with_some_missing_items_throws_exception() { void test_retrieveWorkspaces_with_some_missing_items_throws_exception() {
const std::string name("test_some_missing_items"); const std::string name("test_some_missing_items");
addToADS(name); addToADS(name);
TS_ASSERT_THROWS(ads.retrieveWorkspaces({"a", "b"}), TS_ASSERT_THROWS(ads.retrieveWorkspaces({"a", "b"}),
Exception::NotFoundError); const Exception::NotFoundError &);
ads.remove(name); ads.remove(name);
} }
...@@ -148,7 +149,7 @@ public: ...@@ -148,7 +149,7 @@ public:
const std::string name = "SameName"; const std::string name = "SameName";
TS_ASSERT_THROWS_NOTHING(addToADS(name)); TS_ASSERT_THROWS_NOTHING(addToADS(name));
// Adding again will throw // Adding again will throw
TS_ASSERT_THROWS(addToADS(name), std::runtime_error); TS_ASSERT_THROWS(addToADS(name), const std::runtime_error &);
TS_ASSERT_THROWS_NOTHING(ads.remove(name)); TS_ASSERT_THROWS_NOTHING(ads.remove(name));
} }
...@@ -173,7 +174,7 @@ public: ...@@ -173,7 +174,7 @@ public:
TS_ASSERT_EQUALS(ads.doesExist(name), true); TS_ASSERT_EQUALS(ads.doesExist(name), true);
std::string banned = "Also.Contains.Illegal"; std::string banned = "Also.Contains.Illegal";
// This should not be allowed now. // This should not be allowed now.
TS_ASSERT_THROWS(addToADS(banned), std::invalid_argument); TS_ASSERT_THROWS(addToADS(banned), const std::invalid_argument &);
// Clear up // Clear up
ads.setIllegalCharacterList(""); ads.setIllegalCharacterList("");
} }
...@@ -182,7 +183,7 @@ public: ...@@ -182,7 +183,7 @@ public:
test_AddOrReplace_Does_Not_Throw_When_Adding_Object_That_Has_A_Name_That_Already_Exists() { test_AddOrReplace_Does_Not_Throw_When_Adding_Object_That_Has_A_Name_That_Already_Exists() {
const std::string name("MySpaceAddOrReplace"); const std::string name("MySpaceAddOrReplace");
TS_ASSERT_THROWS_NOTHING(addOrReplaceToADS(name)); TS_ASSERT_THROWS_NOTHING(addOrReplaceToADS(name));
TS_ASSERT_THROWS(addToADS(name), std::runtime_error); TS_ASSERT_THROWS(addToADS(name), const std::runtime_error &);
TS_ASSERT_THROWS_NOTHING(addOrReplaceToADS(name)); TS_ASSERT_THROWS_NOTHING(addOrReplaceToADS(name));
TS_ASSERT_THROWS_NOTHING(ads.remove(name)); TS_ASSERT_THROWS_NOTHING(ads.remove(name));
} }
...@@ -191,7 +192,7 @@ public: ...@@ -191,7 +192,7 @@ public:
const std::string name("MySpace"); const std::string name("MySpace");
addToADS(name); addToADS(name);
TS_ASSERT_THROWS_NOTHING(ads.remove(name)); TS_ASSERT_THROWS_NOTHING(ads.remove(name));
TS_ASSERT_THROWS(ads.retrieve(name), std::runtime_error); TS_ASSERT_THROWS(ads.retrieve(name), const std::runtime_error &);
// Remove should not throw but give a warning in the log file, changed by // Remove should not throw but give a warning in the log file, changed by
// LCC 05/2008 // LCC 05/2008
TS_ASSERT_THROWS_NOTHING(ads.remove("ttttt")); TS_ASSERT_THROWS_NOTHING(ads.remove("ttttt"));
...@@ -328,7 +329,7 @@ public: ...@@ -328,7 +329,7 @@ public:
group->addWorkspace(ws2); group->addWorkspace(ws2);
// ADS must have 2 workspaces // ADS must have 2 workspaces
TS_ASSERT_EQUALS(ads.size(), 2); TS_ASSERT_EQUALS(ads.size(), 2);
TS_ASSERT_THROWS(ads.add("Group", group), std::runtime_error); TS_ASSERT_THROWS(ads.add("Group", group), const std::runtime_error &);
// there must be 4 workspaces in the ADS // there must be 4 workspaces in the ADS
TS_ASSERT_EQUALS(ads.size(), 4); TS_ASSERT_EQUALS(ads.size(), 4);
TS_ASSERT(ads.doesExist("Group")); TS_ASSERT(ads.doesExist("Group"));
...@@ -400,9 +401,10 @@ public: ...@@ -400,9 +401,10 @@ public:
TS_ASSERT_EQUALS(ads.size(), 4); TS_ASSERT_EQUALS(ads.size(), 4);
// name doesn't exist // name doesn't exist
TS_ASSERT_THROWS(ads.deepRemoveGroup("abc"), std::runtime_error); TS_ASSERT_THROWS(ads.deepRemoveGroup("abc"), const std::runtime_error &);
// workspace isn't a group // workspace isn't a group
TS_ASSERT_THROWS(ads.deepRemoveGroup("group_1"), std::runtime_error); TS_ASSERT_THROWS(ads.deepRemoveGroup("group_1"),
const std::runtime_error &);
TS_ASSERT_THROWS_NOTHING(ads.deepRemoveGroup("group")); TS_ASSERT_THROWS_NOTHING(ads.deepRemoveGroup("group"));
TS_ASSERT_EQUALS(ads.size(), 1); TS_ASSERT_EQUALS(ads.size(), 1);
...@@ -423,11 +425,11 @@ public: ...@@ -423,11 +425,11 @@ public:
TS_ASSERT_EQUALS(group->size(), 1); TS_ASSERT_EQUALS(group->size(), 1);
TS_ASSERT_THROWS(ads.removeFromGroup("group", "noworkspace"), TS_ASSERT_THROWS(ads.removeFromGroup("group", "noworkspace"),
std::runtime_error); const std::runtime_error &);
TS_ASSERT_THROWS(ads.removeFromGroup("nogroup", "noworkspace"), TS_ASSERT_THROWS(ads.removeFromGroup("nogroup", "noworkspace"),
std::runtime_error); const std::runtime_error &);
TS_ASSERT_THROWS(ads.removeFromGroup("nogroup", "group_1"), TS_ASSERT_THROWS(ads.removeFromGroup("nogroup", "group_1"),
std::runtime_error); const std::runtime_error &);
ads.clear(); ads.clear();
} }
...@@ -493,9 +495,10 @@ public: ...@@ -493,9 +495,10 @@ public:
auto nullWS = MockWorkspace_sptr(); auto nullWS = MockWorkspace_sptr();
// Shouldn't be able to add null pointers // Shouldn't be able to add null pointers
TS_ASSERT_THROWS(ads.add("null_workspace", nullWS), std::runtime_error); TS_ASSERT_THROWS(ads.add("null_workspace", nullWS),
const std::runtime_error &);
TS_ASSERT_THROWS(ads.addOrReplace("null_workspace", nullWS), TS_ASSERT_THROWS(ads.addOrReplace("null_workspace", nullWS),
std::runtime_error); const std::runtime_error &);
TS_ASSERT(!ads.doesExist("null_workspace")); TS_ASSERT(!ads.doesExist("null_workspace"));
} }
...@@ -519,10 +522,10 @@ private: ...@@ -519,10 +522,10 @@ private:
<< " is not allowed but ADS did not throw."; << " is not allowed but ADS did not throw.";
if (replace) { if (replace) {
TSM_ASSERT_THROWS(errorMsg.str(), addToADS(name.str()), TSM_ASSERT_THROWS(errorMsg.str(), addToADS(name.str()),
std::invalid_argument); const std::invalid_argument &);
} else { } else {
TSM_ASSERT_THROWS(errorMsg.str(), addOrReplaceToADS(name.str()), TSM_ASSERT_THROWS(errorMsg.str(), addOrReplaceToADS(name.str()),
std::invalid_argument); const std::invalid_argument &);
} }
bool stored = ads.doesExist(name.str()); bool stored = ads.doesExist(name.str());
TS_ASSERT_EQUALS(stored, false); TS_ASSERT_EQUALS(stored, false);
......
...@@ -77,8 +77,8 @@ public: ...@@ -77,8 +77,8 @@ public:
ax1.setValue(i, static_cast<double>(i + 1)); ax1.setValue(i, static_cast<double>(i + 1));
} }
TS_ASSERT_THROWS(ax1.indexOfValue(0.9), std::out_of_range); // start TS_ASSERT_THROWS(ax1.indexOfValue(0.9), const std::out_of_range &); // start
TS_ASSERT_THROWS(ax1.indexOfValue(10.1), std::out_of_range); // end TS_ASSERT_THROWS(ax1.indexOfValue(10.1), const std::out_of_range &); // end
} }
}; };
......
...@@ -122,7 +122,7 @@ public: ...@@ -122,7 +122,7 @@ public:
void test_setSplitTopIntoThrowsForWrongDimension() { void test_setSplitTopIntoThrowsForWrongDimension() {
BoxController sc(1); BoxController sc(1);
TSM_ASSERT_THROWS("Should throw for setting a wrong dimension", TSM_ASSERT_THROWS("Should throw for setting a wrong dimension",
sc.setSplitTopInto(1, 10), std::invalid_argument); sc.setSplitTopInto(1, 10), const std::invalid_argument &);
} }
void doTest_numBoxes(BoxController &bc, size_t expectedNumEntries) { void doTest_numBoxes(BoxController &bc, size_t expectedNumEntries) {
......
...@@ -528,12 +528,12 @@ public: ...@@ -528,12 +528,12 @@ public:
mfun->fix(10); mfun->fix(10);
// g2->fix(1); // This doesn't work // g2->fix(1); // This doesn't work
TS_ASSERT_THROWS(mfun->setActiveParameter(0, 0), std::runtime_error); TS_ASSERT_THROWS(mfun->setActiveParameter(0, 0), const std::runtime_error &);
TS_ASSERT_THROWS(mfun->setActiveParameter(1, 0), std::runtime_error); TS_ASSERT_THROWS(mfun->setActiveParameter(1, 0), const std::runtime_error &);
TS_ASSERT_THROWS(mfun->setActiveParameter(4, 0), std::runtime_error); TS_ASSERT_THROWS(mfun->setActiveParameter(4, 0), const std::runtime_error &);
TS_ASSERT_THROWS(mfun->setActiveParameter(6, 0), std::runtime_error); TS_ASSERT_THROWS(mfun->setActiveParameter(6, 0), const std::runtime_error &);
TS_ASSERT_THROWS(mfun->setActiveParameter(7, 0), std::runtime_error); TS_ASSERT_THROWS(mfun->setActiveParameter(7, 0), const std::runtime_error &);
TS_ASSERT_THROWS(mfun->setActiveParameter(10, 0), std::runtime_error); TS_ASSERT_THROWS(mfun->setActiveParameter(10, 0), const std::runtime_error &);
mfun->setActiveParameter(2, 100); mfun->setActiveParameter(2, 100);
mfun->setActiveParameter(3, 101); mfun->setActiveParameter(3, 101);
......
...@@ -72,7 +72,7 @@ public: ...@@ -72,7 +72,7 @@ public:
void test_l1_no_instrument() { void test_l1_no_instrument() {
TS_ASSERT_THROWS(m_workspaceNoInstrument.detectorInfo().l1(), TS_ASSERT_THROWS(m_workspaceNoInstrument.detectorInfo().l1(),
std::runtime_error); const std::runtime_error &);
} }
void test_l1_no_instrument_call_once_regression() { void test_l1_no_instrument_call_once_regression() {
...@@ -82,9 +82,9 @@ public: ...@@ -82,9 +82,9 @@ public:
// call to `l1` can be repeated. If the bug is reintroduced this test will // call to `l1` can be repeated. If the bug is reintroduced this test will
// not fail but FREEZE. // not fail but FREEZE.
TS_ASSERT_THROWS(m_workspaceNoInstrument.detectorInfo().l1(), TS_ASSERT_THROWS(m_workspaceNoInstrument.detectorInfo().l1(),
std::runtime_error); const std::runtime_error &);
TS_ASSERT_THROWS(m_workspaceNoInstrument.detectorInfo().l1(), TS_ASSERT_THROWS(m_workspaceNoInstrument.detectorInfo().l1(),
std::runtime_error); const std::runtime_error &);
} }
void test_isMonitor() { void test_isMonitor() {
...@@ -141,8 +141,8 @@ public: ...@@ -141,8 +141,8 @@ public:
TS_ASSERT_DELTA(detectorInfo.twoTheta(1), 0.0, 1e-6); TS_ASSERT_DELTA(detectorInfo.twoTheta(1), 0.0, 1e-6);
TS_ASSERT_DELTA(detectorInfo.twoTheta(2), 0.0199973, 1e-6); TS_ASSERT_DELTA(detectorInfo.twoTheta(2), 0.0199973, 1e-6);
// Monitors // Monitors
TS_ASSERT_THROWS(detectorInfo.twoTheta(3), std::logic_error); TS_ASSERT_THROWS(detectorInfo.twoTheta(3), const std::logic_error &);
TS_ASSERT_THROWS(detectorInfo.twoTheta(4), std::logic_error); TS_ASSERT_THROWS(detectorInfo.twoTheta(4), const std::logic_error &);
} }
// Legacy test via the workspace method detectorTwoTheta(), which might be // Legacy test via the workspace method detectorTwoTheta(), which might be
...@@ -160,8 +160,8 @@ public: ...@@ -160,8 +160,8 @@ public:
TS_ASSERT_DELTA(detectorInfo.signedTwoTheta(1), 0.0, 1e-6); TS_ASSERT_DELTA(detectorInfo.signedTwoTheta(1), 0.0, 1e-6);
TS_ASSERT_DELTA(detectorInfo.signedTwoTheta(2), 0.0199973, 1e-6); TS_ASSERT_DELTA(detectorInfo.signedTwoTheta(2), 0.0199973, 1e-6);
// Monitors // Monitors
TS_ASSERT_THROWS(detectorInfo.signedTwoTheta(3), std::logic_error); TS_ASSERT_THROWS(detectorInfo.signedTwoTheta(3), const std::logic_error &);
TS_ASSERT_THROWS(detectorInfo.signedTwoTheta(4), std::logic_error); TS_ASSERT_THROWS(detectorInfo.signedTwoTheta(4), const std::logic_error &);
} }
void test_position() { void test_position() {
...@@ -432,7 +432,7 @@ public: ...@@ -432,7 +432,7 @@ public:
auto ws1 = makeWorkspace(1); auto ws1 = makeWorkspace(1);
auto ws2 = makeWorkspace(2); auto ws2 = makeWorkspace(2);
TS_ASSERT_THROWS(ws2->mutableDetectorInfo() = ws1->detectorInfo(), TS_ASSERT_THROWS(ws2->mutableDetectorInfo() = ws1->detectorInfo(),
std::runtime_error); const std::runtime_error &);
} }
private: private:
......
...@@ -113,13 +113,14 @@ public: ...@@ -113,13 +113,14 @@ public:
void test_Setting_A_New_Source_With_NULL_Ptr_Throws() { void test_Setting_A_New_Source_With_NULL_Ptr_Throws() {
ExperimentInfo ws; ExperimentInfo ws;
TS_ASSERT_THROWS(ws.setModeratorModel(nullptr), std::invalid_argument); TS_ASSERT_THROWS(ws.setModeratorModel(nullptr),
const std::invalid_argument &);
} }
void test_Retrieving_Source_Properties_Before_Set_Throws() { void test_Retrieving_Source_Properties_Before_Set_Throws() {
ExperimentInfo ws; ExperimentInfo ws;
TS_ASSERT_THROWS(ws.moderatorModel(), std::runtime_error); TS_ASSERT_THROWS(ws.moderatorModel(), const std::runtime_error &);
} }
void test_Setting_New_Source_Description_With_Valid_Object_Does_Not_Throw() { void test_Setting_New_Source_Description_With_Valid_Object_Does_Not_Throw() {
...@@ -137,7 +138,8 @@ public: ...@@ -137,7 +138,8 @@ public:
void test_Setting_A_New_Chopper_With_NULL_Ptr_Throws() { void test_Setting_A_New_Chopper_With_NULL_Ptr_Throws() {
ExperimentInfo_sptr ws = createTestInfoWithChopperPoints(1); ExperimentInfo_sptr ws = createTestInfoWithChopperPoints(1);
TS_ASSERT_THROWS(ws->setChopperModel(nullptr), std::invalid_argument); TS_ASSERT_THROWS(ws->setChopperModel(nullptr),
const std::invalid_argument &);
} }
void test_Setting_A_New_Chopper_To_Point_Lower_Point_Succeeds() { void test_Setting_A_New_Chopper_To_Point_Lower_Point_Succeeds() {
...@@ -151,13 +153,13 @@ public: ...@@ -151,13 +153,13 @@ public:
ExperimentInfo_sptr ws = createTestInfoWithChopperPoints(1); ExperimentInfo_sptr ws = createTestInfoWithChopperPoints(1);
TS_ASSERT_THROWS_NOTHING(ws->setChopperModel(new FakeChopper)); TS_ASSERT_THROWS_NOTHING(ws->setChopperModel(new FakeChopper));
TS_ASSERT_THROWS(ws->chopperModel(1), std::invalid_argument); TS_ASSERT_THROWS(ws->chopperModel(1), const std::invalid_argument &);
} }
void test_Getting_Chopper_At_Index_Greater_Than_Descriptions_Added_Throws() { void test_Getting_Chopper_At_Index_Greater_Than_Descriptions_Added_Throws() {
ExperimentInfo_sptr ws = createTestInfoWithChopperPoints(1); ExperimentInfo_sptr ws = createTestInfoWithChopperPoints(1);
TS_ASSERT_THROWS(ws->chopperModel(2), std::invalid_argument); TS_ASSERT_THROWS(ws->chopperModel(2), const std::invalid_argument &);
} }
void test_GetSetSample() { void test_GetSetSample() {
...@@ -175,7 +177,7 @@ public: ...@@ -175,7 +177,7 @@ public:
void test_GetLog_Throws_If_No_Log_Or_Instrument_Parameter_Exists() { void test_GetLog_Throws_If_No_Log_Or_Instrument_Parameter_Exists() {
ExperimentInfo expt; ExperimentInfo expt;
TS_ASSERT_THROWS(expt.getLog("__NOTALOG__"), std::invalid_argument); TS_ASSERT_THROWS(expt.getLog("__NOTALOG__"), const std::invalid_argument &);
} }
void void
...@@ -186,7 +188,7 @@ public: ...@@ -186,7 +188,7 @@ public:
addInstrumentWithParameter(expt, instPar, actualLogName); addInstrumentWithParameter(expt, instPar, actualLogName);
TS_ASSERT_THROWS(expt.getLog(instPar), TS_ASSERT_THROWS(expt.getLog(instPar),
Mantid::Kernel::Exception::NotFoundError); const Mantid::Kernel::Exception::NotFoundError &);
} }
void void
...@@ -222,7 +224,7 @@ public: ...@@ -222,7 +224,7 @@ public:
ExperimentInfo expt; ExperimentInfo expt;
TS_ASSERT_THROWS(expt.getLogAsSingleValue("__NOTALOG__"), TS_ASSERT_THROWS(expt.getLogAsSingleValue("__NOTALOG__"),
std::invalid_argument); const std::invalid_argument &);
} }
void void
...@@ -233,7 +235,7 @@ public: ...@@ -233,7 +235,7 @@ public:
addInstrumentWithParameter(expt, instPar, actualLogName); addInstrumentWithParameter(expt, instPar, actualLogName);
TS_ASSERT_THROWS(expt.getLogAsSingleValue(instPar), TS_ASSERT_THROWS(expt.getLogAsSingleValue(instPar),
Mantid::Kernel::Exception::NotFoundError); const Mantid::Kernel::Exception::NotFoundError &);
} }
void void
...@@ -373,7 +375,7 @@ public: ...@@ -373,7 +375,7 @@ public:
ExperimentInfo_sptr exptInfo = createTestInfoWithDirectEModeLog(); ExperimentInfo_sptr exptInfo = createTestInfoWithDirectEModeLog();
TS_ASSERT_THROWS(exptInfo->getEFixed(1), TS_ASSERT_THROWS(exptInfo->getEFixed(1),
Mantid::Kernel::Exception::NotFoundError); const Mantid::Kernel::Exception::NotFoundError &);
} }