MCPcopy Create free account
hub / github.com/MITK/MITK / TestPropAssignment

Method TestPropAssignment

Modules/Core/test/mitkPropertyTest.cpp:103–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101
102 template <class T>
103 void TestPropAssignment(T prop, T prop2, const std::string &strProp)
104 {
105 unsigned long tag = prop->AddObserver(itk::ModifiedEvent(), m_L.m_Cmd.GetPointer());
106
107 mitk::BaseProperty::Pointer baseProp2(prop2.GetPointer());
108 *prop = *baseProp2;
109 CPPUNIT_ASSERT_MESSAGE("Test modified event", m_L.Pop());
110 std::string msg = std::string("Test assignment [") + prop->GetValueAsString() + " == " + strProp + "]";
111 CPPUNIT_ASSERT_MESSAGE(msg, prop->GetValueAsString() == strProp);
112 CPPUNIT_ASSERT_MESSAGE("Test equality", *prop == *prop2);
113 CPPUNIT_ASSERT_MESSAGE("Test equality", *prop == *baseProp2);
114 CPPUNIT_ASSERT_MESSAGE("Test polymorphic equality", *baseProp2 == *prop);
115
116 prop->RemoveObserver(tag);
117 }
118
119 template <class T>
120 void TestPropPolymorphicAssignment(T prop, T prop2, const std::string &strProp)

Callers

nothing calls this directly

Calls 4

AddObserverMethod · 0.80
GetPointerMethod · 0.80
PopMethod · 0.80
GetValueAsStringMethod · 0.45

Tested by

no test coverage detected