Skip to content

Commit

Permalink
Remove explicit references to parameter names in unit test re #3692
Browse files Browse the repository at this point in the history
These will be confined to the test testParameter_Name_Functions() to be added.

Signed-off-by: Karl Palmen <karl.palmen@stfc.ac.uk>
  • Loading branch information
KarlPalmen committed Apr 8, 2013
1 parent c579eb7 commit d33ae58
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Code/Mantid/Framework/Geometry/test/ParameterMapTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ class ParameterMapTest : public CxxTest::TestSuite
const std::string type("int");
const int value(1);
pmap.add<int>("int", m_testInstrument.get(),name,value);
TS_ASSERT_EQUALS(pmap.contains(m_testInstrument.get(), name, "int"), true);
TS_ASSERT_EQUALS(pmap.contains(m_testInstrument.get(), name, "double"), false);
TS_ASSERT_EQUALS(pmap.contains(m_testInstrument.get(), name, ParameterMap::pInt()), true);
TS_ASSERT_EQUALS(pmap.contains(m_testInstrument.get(), name, ParameterMap::pDouble()), false);
}

void testParameter_Name_Matching_Is_Case_Insensitive()
Expand Down Expand Up @@ -146,7 +146,7 @@ class ParameterMapTest : public CxxTest::TestSuite
pmap.addBool(comp.get(), "A", true);
TS_ASSERT_EQUALS(pmap.size(), 1);
// Try to find double type parameters, of which there should be none.
Parameter_sptr fetchedValue = pmap.getByType(comp.get(), "double");
Parameter_sptr fetchedValue = pmap.getByType(comp.get(), ParameterMap::pDouble());
TSM_ASSERT("Should not be able to find a double type parameter", fetchedValue == NULL);
}

Expand All @@ -162,13 +162,13 @@ class ParameterMapTest : public CxxTest::TestSuite
TS_ASSERT_EQUALS(pmap.size(), 2);

// Test the ability to correctly fetch the double argument by type.
Parameter_sptr fetchedValue1 = pmap.getByType(comp.get(), "double");
Parameter_sptr fetchedValue1 = pmap.getByType(comp.get(), ParameterMap::pDouble());
TS_ASSERT(fetchedValue1);
TS_ASSERT_EQUALS("A", fetchedValue1->name());
TS_ASSERT_DELTA(1.2, fetchedValue1->value<double>(), DBL_EPSILON);

// Test the ability to correctly fetch the bool argument by type.
Parameter_sptr fetchedValue2 = pmap.getByType(comp.get(), "bool");
Parameter_sptr fetchedValue2 = pmap.getByType(comp.get(), ParameterMap::pBool());
TS_ASSERT(fetchedValue2);
TS_ASSERT_EQUALS("B", fetchedValue2->name());
TS_ASSERT_EQUALS(true, fetchedValue2->value<bool>());
Expand All @@ -183,7 +183,7 @@ class ParameterMapTest : public CxxTest::TestSuite
pmap.addBool(component.get(), "A", true);

//Find it via the component
Parameter_sptr fetchedValue = pmap.getRecursiveByType(component.get(), "bool");
Parameter_sptr fetchedValue = pmap.getRecursiveByType(component.get(), ParameterMap::pBool());
TS_ASSERT(fetchedValue != NULL);
TS_ASSERT_EQUALS("A", fetchedValue->name());
TS_ASSERT_EQUALS("bool", fetchedValue->type());
Expand All @@ -200,7 +200,7 @@ class ParameterMapTest : public CxxTest::TestSuite
pmap.addBool(parentComponent.get(), "A", true);

//Find it via the child
Parameter_sptr fetchedValue = pmap.getRecursiveByType(childComponent.get(), "bool");
Parameter_sptr fetchedValue = pmap.getRecursiveByType(childComponent.get(), ParameterMap::pBool());
TS_ASSERT(fetchedValue != NULL);
TS_ASSERT_EQUALS("A", fetchedValue->name());
TS_ASSERT_EQUALS("bool", fetchedValue->type());
Expand All @@ -220,10 +220,10 @@ class ParameterMapTest : public CxxTest::TestSuite
pmap.addBool(parentComponent.get(), "B", true);

//Find it via the child
Parameter_sptr fetchedValue = pmap.getRecursiveByType(childComponent.get(), "bool");
Parameter_sptr fetchedValue = pmap.getRecursiveByType(childComponent.get(), ParameterMap::pBool());
TS_ASSERT(fetchedValue != NULL);
TSM_ASSERT_EQUALS("Has not searched through parameters with the correct priority", "A", fetchedValue->name());
TSM_ASSERT_EQUALS("Has not searched through parameters with the correct priority","bool", fetchedValue->type());
TSM_ASSERT_EQUALS("Has not searched through parameters with the correct priority",ParameterMap::pBool(), fetchedValue->type());
TSM_ASSERT_EQUALS("Has not searched through parameters with the correct priority",false, fetchedValue->value<bool>());
}

Expand Down

0 comments on commit d33ae58

Please sign in to comment.