From cd4ab887b1ff501c18e62293c295f8aaa2ee3237 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Tue, 29 Jul 2014 10:05:04 +0100 Subject: [PATCH] Update LoadParameterFileTest. We now test setting parameters by detector id. Refs #9959 --- .../DataHandling/test/LoadParameterFileTest.h | 18 ++++++++++++++++++ .../IDF_for_UNIT_TESTING2_paramFile.xml | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/Code/Mantid/Framework/DataHandling/test/LoadParameterFileTest.h b/Code/Mantid/Framework/DataHandling/test/LoadParameterFileTest.h index e6efa9b134b0..7705eb7da7c0 100644 --- a/Code/Mantid/Framework/DataHandling/test/LoadParameterFileTest.h +++ b/Code/Mantid/Framework/DataHandling/test/LoadParameterFileTest.h @@ -59,6 +59,13 @@ class LoadParameterFileTest : public CxxTest::TestSuite param = paramMap.get(&(*ptrDet), "fjols-test-paramfile"); TS_ASSERT_DELTA( param->value(), 50.0, 0.0001); + ptrDet = i->getDetector(1301); + TS_ASSERT_EQUALS( ptrDet->getID(), 1301); + TS_ASSERT_EQUALS( ptrDet->getName(), "pixel"); + param = paramMap.get(ptrDet.get(), "testDouble"); + TS_ASSERT_DELTA( param->value(), 25.0, 0.0001); + TS_ASSERT_EQUALS( paramMap.getString(ptrDet.get(), "testString"), "hello world"); + std::vector dummy = paramMap.getDouble("nickel-holder", "klovn"); TS_ASSERT_DELTA( dummy[0], 1.0, 0.0001); dummy = paramMap.getDouble("nickel-holder", "pos"); @@ -92,6 +99,10 @@ class LoadParameterFileTest : public CxxTest::TestSuite " " " " " " + " " + " " + " " + " " ""; // load in additional parameters @@ -118,6 +129,13 @@ class LoadParameterFileTest : public CxxTest::TestSuite param = paramMap.get(&(*ptrDet), "fjols-test-paramfile"); TS_ASSERT_DELTA( param->value(), 52.0, 0.0001); + ptrDet = i->getDetector(1301); + TS_ASSERT_EQUALS( ptrDet->getID(), 1301); + TS_ASSERT_EQUALS( ptrDet->getName(), "pixel"); + param = paramMap.get(ptrDet.get(), "testDouble"); + TS_ASSERT_DELTA( param->value(), 27.0, 0.0001); + TS_ASSERT_EQUALS( paramMap.getString(ptrDet.get(), "testString"), "goodbye world"); + std::vector dummy = paramMap.getDouble("nickel-holder", "klovn"); TS_ASSERT_DELTA( dummy[0], 1.0, 0.0001); dummy = paramMap.getDouble("nickel-holder", "pos"); diff --git a/Code/Mantid/instrument/IDFs_for_UNIT_TESTING/IDF_for_UNIT_TESTING2_paramFile.xml b/Code/Mantid/instrument/IDFs_for_UNIT_TESTING/IDF_for_UNIT_TESTING2_paramFile.xml index e41e3966d94c..dc46e5af59f5 100644 --- a/Code/Mantid/instrument/IDFs_for_UNIT_TESTING/IDF_for_UNIT_TESTING2_paramFile.xml +++ b/Code/Mantid/instrument/IDFs_for_UNIT_TESTING/IDF_for_UNIT_TESTING2_paramFile.xml @@ -9,4 +9,9 @@ + + + + +