30 std::string testValue1AsString,
31 std::string testValue2AsString,
34 std::cout <<
"Testing mitk::GenericProperty<" << type <<
">(" << testValue1AsString <<
", " << testValue2AsString
41 unsigned long tBefore = prop->GetMTime();
42 prop->SetValue(testValue1);
43 unsigned long tAfter = prop->GetMTime();
44 prop->SetValue(testValue1);
45 unsigned long tAfterAll = prop->GetMTime();
52 prop->SetValue(testValue2);
53 unsigned long tAfterEverything = prop->GetMTime();
55 std::cout <<
" Testing MTime correctness when changing property value: ";
56 if (tBefore >= tAfter || tAfterAll != tAfter || tAfterEverything <= tAfterAll)
58 std::cout <<
"[FAILED]" << std::endl;
61 std::cout <<
"[PASSED]" << std::endl;
63 prop->SetValue(testValue1);
64 std::cout <<
" Testing Assignment: ";
65 prop->AssignProperty(*prop3);
66 if ((!(*prop == *prop3)) || (*prop == *prop2))
68 std::cout <<
" [FAILED]" << std::endl;
71 std::cout <<
"[PASSED]" << std::endl;
72 std::cout << std::endl;
82 TestGenericPropertyForDataType<mitk::IntProperty>(1, 2,
"1",
"2",
"int");
83 TestGenericPropertyForDataType<mitk::BoolProperty>(
true,
false,
"1",
"0",
"bool");
84 TestGenericPropertyForDataType<mitk::FloatProperty>(1.0, -1.0,
"1",
"-1",
"float");
85 TestGenericPropertyForDataType<mitk::DoubleProperty>(1.0, -1.0,
"1",
"-1",
"double");
86 TestGenericPropertyForDataType<mitk::UIntProperty>(1, 100000,
"1",
"100000",
"unsigned int");
87 TestGenericPropertyForDataType<mitk::UShortProperty>(1, 20000,
"1",
"20000",
"unsigned short");
89 TestGenericPropertyForDataType<mitk::StringProperty>(
90 std::string(
"eins"), std::string(
"zwei"), std::string(
"eins"), std::string(
"zwei"),
"std::string");
101 TestGenericPropertyForDataType<mitk::Point3dProperty>(p1, p2,
"[2, 3, 4]",
"[-1, 2, 3]",
"mitk::Point3D");
115 TestGenericPropertyForDataType<mitk::Point4dProperty>(p1, p2,
"[2, 3, 4, -2]",
"[-1, 2, 3, 5]",
"mitk::Point4D");
135 TestGenericPropertyForDataType<mitk::Vector3DProperty>(p1, p2,
"[2, 3, 4]",
"[-1, 2, 3]",
"mitk::Vector3D");
itk::SmartPointer< Self > Pointer
int TestGenericPropertyForDataType(typename T::ValueType testValue1, typename T::ValueType testValue2, std::string testValue1AsString, std::string testValue2AsString, std::string type)
#define MITK_TEST_CONDITION_REQUIRED(COND, MSG)
section GeneralTestsDeprecatedOldTestingStyle Deprecated macros All tests with MITK_TEST_BEGIN()
ValueType
Type of the value held by a Value object.
int mitkGenericPropertyTest(int, char *[])
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.