| 144 | |
| 145 | template <class T> |
| 146 | void TestProperty(const typename T::ValueType &v1, |
| 147 | const typename T::ValueType &v2, |
| 148 | const std::string &strV1, |
| 149 | const std::string &strV2) |
| 150 | { |
| 151 | typename T::Pointer prop = T::New(v1); |
| 152 | MITK_TEST_OUTPUT(<< "**** Test [" << prop->GetNameOfClass() << "] ****"); |
| 153 | |
| 154 | CPPUNIT_ASSERT_MESSAGE("Test constructor", prop->GetValue() == v1); |
| 155 | std::string msg = std::string("Test GetValueAsString() [") + prop->GetValueAsString() + " == " + strV1 + "]"; |
| 156 | CPPUNIT_ASSERT_MESSAGE(msg, prop->GetValueAsString() == strV1); |
| 157 | |
| 158 | TestPropCloning(prop); |
| 159 | |
| 160 | typename T::Pointer prop2 = T::New(); |
| 161 | prop2->AddObserver(itk::ModifiedEvent(), m_L.m_Cmd.GetPointer()); |
| 162 | CPPUNIT_ASSERT_MESSAGE("Test modified", !m_L.m_Modified); |
| 163 | prop2->SetValue(v2); |
| 164 | CPPUNIT_ASSERT_MESSAGE("Test modified", m_L.Pop()); |
| 165 | CPPUNIT_ASSERT_MESSAGE("Test SetValue()", prop2->GetValue() == v2); |
| 166 | prop2->SetValue(v2); |
| 167 | CPPUNIT_ASSERT_MESSAGE("Test for no modification", !m_L.Pop()); |
| 168 | |
| 169 | TestPropInequality(prop, prop2); |
| 170 | TestPropAssignment(prop, prop2, strV2); |
| 171 | |
| 172 | prop->SetValue(v1); |
| 173 | TestPropPolymorphicAssignment(prop2, prop, strV1); |
| 174 | } |
| 175 | |
| 176 | void TestBoolProperty_Success() |
| 177 | { |
nothing calls this directly
no test coverage detected