Commit 7b50b884 authored by Gagik Vardanyan's avatar Gagik Vardanyan
Browse files

unit test with a new file

parent 5ab3a512
......@@ -183,11 +183,11 @@ public:
checkTimeFormat(outputWS);
}
void test_d22B() {
void trest_d22B() {
LoadILLSANS alg;
alg.setChild(true);
alg.initialize();
TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("Filename", "375508.nxs"))
TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("Filename", "000180.nxs"))
TS_ASSERT_THROWS_NOTHING(
alg.setPropertyValue("OutputWorkspace", "__unused_for_child"))
TS_ASSERT_THROWS_NOTHING(alg.execute())
......@@ -200,27 +200,31 @@ public:
TS_ASSERT(outputWS->detectorInfo().isMonitor(128 * 256 + 96 * 256 + 1))
TS_ASSERT(outputWS->isHistogramData())
TS_ASSERT(!outputWS->isDistribution())
TS_ASSERT_EQUALS(outputWS->getAxis(0)->unit()->unitID(), "Wavelength");
const auto &instrument = outputWS->getInstrument();
const auto &run = outputWS->run();
// TODO SET CORRECT COORDINATES
IComponent_const_sptr comp = instrument->getComponentByName("detector");
V3D pos = comp->getPos();
TS_ASSERT_DELTA(pos.Z(), 16.874, 1E-5)
TS_ASSERT(run.hasProperty("Detector 2.det2_calc"))
double det2_calc = run.getLogAsSingleValue("Detector 2.det2_calc");
TS_ASSERT(run.hasProperty("Detector_2.dtr2_actual"))
double dtr2_act = run.getLogAsSingleValue("Detector_2.dtr2_actual");
TS_ASSERT_DELTA(pos.Z(), det2_calc, 1E-6)
TS_ASSERT_DELTA(pos.X(), -dtr2_act / 1000., 1E-6)
TS_ASSERT(run.hasProperty("L2"))
double l2 = run.getLogAsSingleValue("L2");
TS_ASSERT_DELTA(l2, det2_calc, 1E-6)
comp = instrument->getComponentByName("detector_right");
pos = comp->getPos();
TS_ASSERT_DELTA(pos.Z(), 16.874, 1E-5)
TS_ASSERT(run.hasProperty("Detector 1.det1_calc"))
double det1_calc = run.getLogAsSingleValue("Detector 1.det1_calc");
TS_ASSERT(run.hasProperty("Detector_1.dtr1_actual"))
double dtr1_act = run.getLogAsSingleValue("Detector_1.dtr1_actual");
TS_ASSERT_DELTA(pos.Z(), det1_calc, 1E-6)
TS_ASSERT_DELTA(pos.X(), -dtr1_act / 1000., 1E-6)
const auto &xAxis = outputWS->x(0).rawData();
const auto &spec = outputWS->y(1280).rawData();
const auto &err = outputWS->e(1280).rawData();
TS_ASSERT_EQUALS(xAxis.size(), 2)
TS_ASSERT_DELTA(xAxis[0], 6.65, 1E-5)
TS_ASSERT_DELTA(xAxis[1], 7.35, 1E-5)
TS_ASSERT_EQUALS(spec[0], 10)
TS_ASSERT_DELTA(err[0], sqrt(10), 1E-5)
const auto unit = outputWS->getAxis(0)->unit()->unitID();
TS_ASSERT_EQUALS(unit, "Wavelength");
checkTimeFormat(outputWS);
}
......
527e6bb9408698de0a9c885f212f7fc4
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