Skip to content
Snippets Groups Projects
Commit e7fbaec9 authored by Martyn Gigg's avatar Martyn Gigg
Browse files

Fix test input values and check for bad input.

parent d13c0800
No related branches found
No related tags found
No related merge requests found
......@@ -158,7 +158,12 @@ void SaveGDA::exec() {
const auto matrixWS = boost::dynamic_pointer_cast<MatrixWorkspace>(ws);
const auto &d = matrixWS->x(0);
const auto &bankCalibParams = calibParams[groupingScheme[i] - 1];
const size_t bankIndex(groupingScheme[i] - 1);
if (bankIndex >= calibParams.size()) {
throw Kernel::Exception::IndexError(bankIndex, calibParams.size(),
"Bank number out of range");
}
const auto &bankCalibParams = calibParams[bankIndex];
// For historic reasons, TOF is scaled by 32 in MAUD
const static double tofScale = 32;
......
......@@ -132,7 +132,7 @@ public:
testAlg.initialize();
testAlg.setProperty("InputWorkspace", INPUT_GROUP_NAME);
testAlg.setProperty("GSASParamFile", m_paramsFile.path());
testAlg.setProperty("GroupingScheme", std::vector<int>({2, 3}));
testAlg.setProperty("GroupingScheme", std::vector<int>({1, 2}));
Poco::TemporaryFile tempFile;
const std::string &tempFileName = tempFile.path();
testAlg.setProperty("Filename", tempFileName);
......@@ -193,7 +193,7 @@ public:
testAlg.initialize();
testAlg.setProperty("InputWorkspace", INPUT_GROUP_NAME);
testAlg.setProperty("GSASParamFile", m_paramsFile.path());
testAlg.setProperty("GroupingScheme", std::vector<int>({2, 3}));
testAlg.setProperty("GroupingScheme", std::vector<int>({1, 2}));
Poco::TemporaryFile tempFile;
const std::string &tempFileName = tempFile.path();
testAlg.setProperty("Filename", tempFileName);
......@@ -229,15 +229,15 @@ public:
TS_ASSERT_EQUALS(error.size(), expectedNumPoints);
// Test a few reference values
TS_ASSERT_EQUALS(tof[103], 99772);
TS_ASSERT_EQUALS(tof[103], 49920);
TS_ASSERT_EQUALS(intensity[103], 1);
TS_ASSERT_EQUALS(error[103], 34);
TS_ASSERT_EQUALS(tof[123], 100725);
TS_ASSERT_EQUALS(tof[123], 50398);
TS_ASSERT_EQUALS(intensity[123], 1);
TS_ASSERT_EQUALS(error[123], 35);
TS_ASSERT_EQUALS(tof[3000], 239053);
TS_ASSERT_EQUALS(tof[3000], 119009);
TS_ASSERT_EQUALS(intensity[3000], 800);
TS_ASSERT_EQUALS(error[3000], 894);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment