23 CPPUNIT_TEST_SUITE(mitkEqualTestSuite);
24 MITK_TEST(Equal_SameMitkVector3D_ReturnTrue);
25 MITK_TEST(Equal_SameMitkVector2D_ReturnTrue);
26 MITK_TEST(Equal_DifferentMitkVector3D_ReturnFalse);
27 MITK_TEST(Equal_DifferentMitkVector2D_ReturnFalse);
28 MITK_TEST(Equal_SameMitkVnlVector_ReturnTrue);
29 MITK_TEST(Equal_DifferentMitkVnlVector_ReturnFalse);
30 MITK_TEST(Equal_SameVnlVector_ReturnTrue);
31 MITK_TEST(Equal_DifferentVnlVector_ReturnFalse);
32 MITK_TEST(Equal_SameItkVector_ReturnTrue);
33 MITK_TEST(Equal_DifferentItkVector_ReturnFalse);
35 MITK_TEST(Equal_DifferentScalar_ReturnFalse);
37 MITK_TEST(Equal_DifferentItkPoint_ReturnFalse);
38 CPPUNIT_TEST_SUITE_END();
41 void Equal_SameMitkVector3D_ReturnTrue()
50 void Equal_SameMitkVector2D_ReturnTrue()
59 void Equal_DifferentMitkVector3D_ReturnFalse()
69 CPPUNIT_ASSERT_EQUAL_MESSAGE(
70 "Coparison of 2 different 3D MITK vectors (first element). Result should be false.",
mitk::Equal(v1, v2),
false);
75 CPPUNIT_ASSERT_EQUAL_MESSAGE(
76 "Coparison of 2 different 3D MITK vectors (second element). Result should be false.",
mitk::Equal(v1, v3),
false);
81 CPPUNIT_ASSERT_EQUAL_MESSAGE(
82 "Coparison of 2 different 3D MITK vectors (third element). Result should be false.",
mitk::Equal(v1, v4),
false);
85 void Equal_DifferentMitkVector2D_ReturnFalse()
93 CPPUNIT_ASSERT_EQUAL_MESSAGE(
94 "Coparison of 2 different 2D MITK vectors (first element). Result should be false.",
mitk::Equal(v1, v2),
false);
98 CPPUNIT_ASSERT_EQUAL_MESSAGE(
99 "Coparison of 2 different 2D MITK vectors (second element). Result should be false.",
mitk::Equal(v1, v3),
false);
102 void Equal_SameMitkVnlVector_ReturnTrue()
111 void Equal_DifferentMitkVnlVector_ReturnFalse()
118 CPPUNIT_ASSERT_EQUAL_MESSAGE(
119 "Comparison of 2 different MITK VNL vectors. Result should be false.",
mitk::Equal(v1, v2),
false);
122 void Equal_SameVnlVector_ReturnTrue()
124 vnl_vector_fixed<mitk::ScalarType, 4u> v1;
126 vnl_vector_fixed<mitk::ScalarType, 4u> v2;
131 void Equal_DifferentVnlVector_ReturnFalse()
133 vnl_vector_fixed<mitk::ScalarType, 2u> v1;
135 vnl_vector_fixed<mitk::ScalarType, 2u> v2;
138 CPPUNIT_ASSERT_EQUAL_MESSAGE(
139 "Comparison of 2 different VNL vectors (first element). Result should be false.",
mitk::Equal(v1, v2),
false);
140 vnl_vector_fixed<mitk::ScalarType, 2u> v3;
143 CPPUNIT_ASSERT_EQUAL_MESSAGE(
144 "Comparison of 2 different VNL vectors (first element). Result should be false.",
mitk::Equal(v1, v3),
false);
147 void Equal_SameItkVector_ReturnTrue()
149 itk::Vector<mitk::ScalarType, 3u> v1;
151 itk::Vector<mitk::ScalarType, 3u> v2;
157 void Equal_DifferentItkVector_ReturnFalse()
159 itk::Vector<mitk::ScalarType, 3u> v1;
161 itk::Vector<mitk::ScalarType, 3u> v2;
163 v2.SetElement(0, 1.4);
164 CPPUNIT_ASSERT_EQUAL_MESSAGE(
165 "Coparison of 2 different ITK vectors (first element). Result should be false.",
mitk::Equal(v1, v2),
false);
166 itk::Vector<mitk::ScalarType, 3u> v3;
168 v3.SetElement(1, 1.4);
169 CPPUNIT_ASSERT_EQUAL_MESSAGE(
170 "Coparison of 2 different ITK vectors (second element). Result should be false.",
mitk::Equal(v1, v3),
false);
171 itk::Vector<mitk::ScalarType, 3u> v4;
173 v4.SetElement(2, 1.4);
174 CPPUNIT_ASSERT_EQUAL_MESSAGE(
175 "Coparison of 2 different ITK vectors (third element). Result should be false.",
mitk::Equal(v1, v4),
false);
178 void Equal_SameScalar_ReturnTrue()
185 void Equal_DifferentScalar_ReturnFalse()
189 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Comparison of 2 different scalars. Result should be false",
mitk::Equal(a, b),
false);
192 void Equal_SameItkPoint_ReturnTrue()
194 itk::Point<mitk::ScalarType, 2> p1;
196 itk::Point<mitk::ScalarType, 2> p2;
201 void Equal_DifferentItkPoint_ReturnFalse()
203 itk::Point<mitk::ScalarType, 2> p1;
205 itk::Point<mitk::ScalarType, 2> p2;
208 CPPUNIT_ASSERT_EQUAL_MESSAGE(
209 "Comparison of 2 different points (first element). Result should be false.",
mitk::Equal(p1, p2),
false);
210 itk::Point<mitk::ScalarType, 2> p3;
213 CPPUNIT_ASSERT_EQUAL_MESSAGE(
214 "Comparison of 2 different points (second element). Result should be false.",
mitk::Equal(p1, p3),
false);
MITK_TEST_SUITE_REGISTRATION(mitkImageToItk)
vnl_vector< ScalarType > VnlVector
#define MITK_TEST(TESTMETHOD)
Adds a test to the current test suite.
Test fixture for parameterized tests.
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
MITKCORE_EXPORT const ScalarType eps