Skip to content

Commit

Permalink
refs #6667 finally correct test verifying the component type name
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts committed Jun 6, 2013
1 parent be8737a commit ea809f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 0 additions & 5 deletions Code/Mantid/Framework/Geometry/test/ComponentTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,6 @@ class ComponentTest : public CxxTest::TestSuite
TS_ASSERT_EQUALS(ancs[0]->getName(), parent.getName());
TS_ASSERT(ancs[0]->isParametrized());

// HACK: 06/06/2013
// something very dodgy occurs here as pq has no name e.g.
// std::string type= pq.getParameterType("Child"); is "" -- it does not find Child!
// And this throws as parent is not parameterized
// std::string type= parent.getParameterType("Child");
}

void testGetFullName()
Expand Down
12 changes: 11 additions & 1 deletion Code/Mantid/Framework/Geometry/test/ParametrizedComponentTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ParametrizedComponentTest : public CxxTest::TestSuite
TS_ASSERT_EQUALS(pq.getRelativeRot(),Quat(1,1,1,1));
}

void testGetParameter()
void testGetParameterAndItsType()
{
Component * paramComp = createSingleParameterizedComponent();
TS_ASSERT_EQUALS(paramComp->getStringParameter(m_strName).size(), 1);
Expand All @@ -88,6 +88,16 @@ class ParametrizedComponentTest : public CxxTest::TestSuite
TS_ASSERT_EQUALS(paramComp->getPositionParameter(m_posName)[0], m_posValue);
TS_ASSERT_EQUALS(paramComp->getRotationParameter(m_quatName)[0], m_quatValue);

std::string typeName;
TS_ASSERT_THROWS_NOTHING(typeName= paramComp->getParameterType(m_strName));
TS_ASSERT_EQUALS(ParameterMap::pString(),typeName);
TS_ASSERT_THROWS_NOTHING(typeName= paramComp->getParameterType(m_dblName));
TS_ASSERT_EQUALS(ParameterMap::pDouble(),typeName);
TS_ASSERT_THROWS_NOTHING(typeName= paramComp->getParameterType(m_posName));
TS_ASSERT_EQUALS(ParameterMap::pV3D(),typeName);
TS_ASSERT_THROWS_NOTHING(typeName= paramComp->getParameterType(m_quatName));
TS_ASSERT_EQUALS(ParameterMap::pQuat(),typeName);

cleanUpComponent();
}

Expand Down

0 comments on commit ea809f1

Please sign in to comment.