Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "mitkClaronTool.h"
00019 #include "mitkTestingMacros.h"
00020
00027 class ClaronToolTestClass : public mitk::ClaronTool
00028 {
00029 public:
00030 mitkClassMacro(ClaronToolTestClass, ClaronTool);
00034 itkNewMacro(Self);
00035 protected:
00036 ClaronToolTestClass() : mitk::ClaronTool()
00037 {
00038 }
00039 };
00040
00044 int mitkClaronToolTest(int , char* [])
00045 {
00046
00047 MITK_TEST_BEGIN("ClaronTool")
00048 {
00049
00050 mitk::ClaronTool::Pointer myClaronTool = ClaronToolTestClass::New().GetPointer();
00051
00052
00053
00054
00055 MITK_TEST_CONDITION_REQUIRED(myClaronTool.IsNotNull(),"Testing instantiation:")
00056
00057 mitk::Point3D pos;
00058 pos[0] = 10;
00059 pos[1] = 20;
00060 pos[2] = 30;
00061 myClaronTool->SetPosition(pos);
00062 mitk::Point3D testPos;
00063 myClaronTool->GetPosition(testPos);
00064 MITK_TEST_CONDITION((testPos==pos),"Testing position update:")
00065
00066 mitk::Quaternion orientation(10,20,30,40);
00067 myClaronTool->SetOrientation(orientation);
00068 mitk::Quaternion testOri;
00069 myClaronTool->GetOrientation(testOri);
00070 MITK_TEST_CONDITION((testOri==orientation),"Testing orientation update:")
00071
00072 std::string name = "//testfilename";
00073 std::string name1 = "/testfilename";
00074 std::string name2 = "testfilename";
00075 MITK_TEST_CONDITION(myClaronTool->LoadFile(name) == true ,"Test LoadFile() with valid windows file name")
00076 MITK_TEST_CONDITION(myClaronTool->LoadFile(name1) == true ,"Test LoadFile() with valid Linux file name")
00077 MITK_TEST_CONDITION(myClaronTool->LoadFile(name2) == false, "Test LoadFile() with invalid file name")
00078 MITK_TEST_CONDITION(myClaronTool->GetCalibrationName() == name2 ,"Test GetCalibrationName() after setting with LoadFile()")
00079 myClaronTool->SetCalibrationName(name);
00080 MITK_TEST_CONDITION(myClaronTool->GetCalibrationName() == name ,"Test GetCalibrationName() after setting with SetCalibrationName()")
00081
00082 myClaronTool->LoadFile(name);
00083 MITK_TEST_CONDITION(myClaronTool->GetFile() == name ,"Testing GetFile() after setting file name with LoadFile()")
00084
00085 }
00086
00087 MITK_TEST_END()
00088 }
00089