MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkToFCameraPMDMITKPlayerControllerTest.cpp
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12
13#include <mitkTestingMacros.h>
14#include <mitkToFCameraPMDMITKPlayerController.h>
15#include <mitkToFConfig.h>
16
20int mitkToFCameraPMDMITKPlayerControllerTest(int /* argc */, char* /*argv*/[])
21{
22 MITK_TEST_BEGIN("ToFCameraPMDMITKPlayerController");
23
24 mitk::ToFCameraPMDMITKPlayerController::Pointer testObject = mitk::ToFCameraPMDMITKPlayerController::New();
25 MITK_TEST_CONDITION_REQUIRED(!(testObject.GetPointer() == nullptr) ,"Testing initialization class");
26 MITK_TEST_CONDITION_REQUIRED(testObject->GetCaptureHeight()== 200 ,"Testing initialization of CaptureHeight");
27 MITK_TEST_CONDITION_REQUIRED(testObject->GetCaptureWidth()== 200 ,"Testing initialization of CaptureWidth");
28 // test empty file behavior
29 std::string testFile = "";
30 testObject->SetInputFileName(testFile);
31 MITK_TEST_CONDITION_REQUIRED(testObject->OpenCameraConnection(),"Testing open camera without valid data");
32 //MITK_TEST_CONDITION_REQUIRED(!testObject->CloseCameraConnection(),"Testing closing of connection");
33
34 //test valid data behavior
35 //CAVE: The following test cases are valid once rawData recording is fixed. Currently the
36 // functionality is not working therefor the test cases are excluded!!
37
38 //std::string filePath = MITK_TOF_DATA_DIR;
39 //testFile = "/aa_raw.nrrd";
40 //filePath.append(testFile);
41 //testObject->SetInputFileName(filePath);
42 //MITK_TEST_CONDITION_REQUIRED( testObject->OpenCameraConnection(),"Testing open camera with valid data");
43 //MITK_TEST_CONDITION_REQUIRED( testObject->GetIntegrationTime() == 2500,"Testing correct setting of integration time!");
44 //MITK_TEST_CONDITION_REQUIRED( testObject->GetModulationFrequency() == 20,"Testing correct setting of modulation frequency!");
45 //
47 //int size = testObject->GetSourceDataStructSize();
48 //MITK_TEST_CONDITION_REQUIRED( size != 0 , "Testing correct setting of source data size!" )
49 //char* sourceData = nullptr;
50 //testObject->GetSourceData( sourceData );
51 //MITK_TEST_CONDITION_REQUIRED( sourceData == nullptr, "Testing setting of source data without update camera!");
52 //testObject->UpdateCamera();
53 //sourceData = new char[size];
54 //testObject->GetSourceData(sourceData);
55 //MITK_TEST_CONDITION_REQUIRED( sourceData != nullptr, "Testing setting of source data with update camera!");
56 //delete[] sourceData;
57 MITK_TEST_CONDITION( testObject->CloseCameraConnection(),"Closing Connection!");
58
59 MITK_TEST_END();
60
61}git st
int mitkToFCameraPMDMITKPlayerControllerTest(int, char *[])