Skip to content
Snippets Groups Projects
Commit 3312b4d9 authored by Matt King's avatar Matt King
Browse files

fixed comparison between min and max when min larger

Refs #13508
parent ccd0912e
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ createPBinStringVector(std::vector<Mantid::coord_t> minVector,
std::vector<std::string> pBinStrVector;
for (size_t iter = 0; iter < numDims; iter++) {
// creating pbin string using Min and Max Centre positions
if (minVector[iter] > maxVector[iter]) {
if (minVector[iter] >= maxVector[iter]) {
throw std::invalid_argument(
"Minimum extents MUST be less than Maximum extents");
}
......
......@@ -240,4 +240,36 @@ public:
// Performance Tests
//===================
// TODO:
using namespace Mantid::DataObjects;
class CompactMDTestPerformance : public CxxTest::TestSuite {
private:
MDHistoWorkspace_sptr m_ws;
public:
// This pair of boilerplate methods prevent the suite being created statically
// This means the constructor isn't called when running other tests
static CompactMDTestPerformance *createSuite() {
return new CompactMDTestPerformance();
}
static void destroySuite(CompactMDTestPerformance *suite) { delete suite; }
CompactMDTestPerformance() {
// Create a 4D workspace.
m_ws = MDEventsTestHelper::makeFakeMDHistoWorkspace(
1.0 /*signal*/, 4 /*nd*/, 100 /*nbins*/, 10 /*max*/, 1.0 /*error sq*/);
}
void test_execute_4d() {
CompactMD alg;
alg.setChild(true);
alg.setRethrows(true);
alg.initialize();
alg.setProperty("InputWorkspace", m_ws);
alg.setProperty("OutputWorkspace", "out");
alg.execute();
IMDHistoWorkspace_sptr outWS = alg.getProperty("OutputWorkspace");
TS_ASSERT(outWS);
}
};
#endif // !MANTID_MDALGORITHMS_COMPACTMDTEST_H_
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