Unverified Commit c0248721 authored by Peterson, Peter's avatar Peterson, Peter Committed by GitHub
Browse files

Merge pull request #31988 from peterfpeterson/catch_by_reference

Catch exceptions by reference (ornl-next)
parents c9ea8af1 ee8863ba
......@@ -65,6 +65,7 @@ public:
TS_ASSERT_EQUALS(preview.type(), IPreview::PreviewType::SVIEW);
}
void test_get_preview_by_non_existent_name() {
TS_ASSERT_THROWS(PreviewManager::Instance().getPreview("TestFacility", "SANS", "BasicPreview2"), std::runtime_error)
TS_ASSERT_THROWS(PreviewManager::Instance().getPreview("TestFacility", "SANS", "BasicPreview2"),
const std::runtime_error &)
}
};
......@@ -144,8 +144,8 @@ public:
}
void test_getParameters_throws_if_no_fitted_data_correct_value() {
TS_ASSERT_THROWS(m_model->getParameters(FitDomainIndex{0}), std::invalid_argument);
TS_ASSERT_THROWS(m_model->getParameters(FitDomainIndex{6}), std::invalid_argument);
TS_ASSERT_THROWS(m_model->getParameters(FitDomainIndex{0}), const std::invalid_argument &);
TS_ASSERT_THROWS(m_model->getParameters(FitDomainIndex{6}), const std::invalid_argument &);
}
void test_getResultLocaton() {
......@@ -165,4 +165,4 @@ public:
private:
std::unique_ptr<IndirectFitOutputModel> m_model;
};
\ No newline at end of file
};
......@@ -769,7 +769,7 @@ public:
auto model = createModelWithSingleWorkspace("wsName", 1);
auto foo = model->createDisplayName(TableDatasetIndex{0});
TS_ASSERT_THROWS(model->createDisplayName(TableDatasetIndex{1}), std::runtime_error);
TS_ASSERT_THROWS(model->createDisplayName(TableDatasetIndex{1}), const std::runtime_error &);
}
void test_createDisplayName_produces_correct_format() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment