35 CPPUNIT_TEST_SUITE(mitkPointSetPointOperationsTestSuite);
37 MITK_TEST(TestCreateOperationAndAddPoint);
40 MITK_TEST(TestPointOperationOpSelectPoint);
46 CPPUNIT_TEST_SUITE_END();
63 pointSet->InsertPoint(2, point2);
64 pointSet->InsertPoint(3, point3);
65 pointSet->InsertPoint(4, point4);
68 void tearDown()
override 74 void TestCreateOperationAndAddPoint()
82 pointSet->ExecuteOperation(doOp);
83 CPPUNIT_ASSERT_EQUAL_MESSAGE(
84 "check if added points exists",
true, pointSet->GetSize() == 4 && pointSet->IndexExists(
id));
89 tempPoint = pointSet->GetPoint(
id);
91 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"check if added point contains real value",
true, point == tempPoint);
94 void TestPointOperationOpMove()
104 pointSet->ExecuteOperation(doOp);
105 tempPoint = pointSet->GetPoint(
id);
107 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"check PointOperation OpMove ",
true, tempPoint == point1);
120 void TestPointOperationOpRemove()
127 point = pointSet->GetPoint(
id);
131 pointSet->ExecuteOperation(doOp);
132 tempPoint = pointSet->GetPoint(
id);
134 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"check PointOperation OpREMOVE ",
false, pointSet->IndexExists(
id));
147 void TestPointOperationOpSelectPoint()
154 pointSet->ExecuteOperation(doOp);
156 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"check PointOperation OpSELECTPOINT ",
true, pointSet->GetSelectInfo(3));
169 void TestOpDeselectPoint()
176 pointSet->ExecuteOperation(doOp);
178 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"check PointOperation OpDESELECTPOINT ",
false, pointSet->GetSelectInfo(4));
179 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"check GetNumeberOfSelected ",
true, pointSet->GetNumberOfSelected() == 0);
200 void TestOpMovePointUp()
210 pointSet->ExecuteOperation(doOp);
213 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"check PointOperation OpMOVEPOINTUP ",
true, tempPoint == point);
226 void TestOpMovePointDown()
235 pointSet->ExecuteOperation(doOp);
238 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"check PointOperation OpMOVEPOINTDOWN ",
true, tempPoint == point);
250 void TestOpMovePointUpOnFirstPoint()
259 pointSet->ExecuteOperation(doOp);
264 CPPUNIT_ASSERT_EQUAL_MESSAGE(
265 "check PointOperation OpMOVEPOINTUP for point id 1: ",
true, ((newP1 == p1) && (newP2 == p2)));
MITK_TEST_SUITE_REGISTRATION(mitkImageToItk)
#define MITK_TEST(TESTMETHOD)
Adds a test to the current test suite.
Constants for most interaction classes, due to the generic StateMachines.
Test fixture for parameterized tests.
Operation that handles all actions on one Point.