18 class ItkLoggingTestClass :
public itk::Object
22 itkFactorylessNewMacro(Self) itkCloneMacro(Self)
24 void TestItkWarningMessage()
26 itkWarningMacro(
"Test ITK Warning message");
31 class LoggingAdapterTestClass
34 static void TestVtkLoggingWithoutAdapter()
37 <<
"Testing vtk logging without adapter class: a separate window should open and display the logging messages.")
38 vtkOutputWindow::GetInstance()->DisplayText("Test VTK InfoMessage");
39 vtkOutputWindow::GetInstance()->DisplayDebugText("Test Vtk
Debug Message");
40 vtkOutputWindow::GetInstance()->DisplayGenericWarningText("Test Vtk Generic Warning Message");
41 vtkOutputWindow::GetInstance()->DisplayWarningText("Test Vtk Warning Message");
42 vtkOutputWindow::GetInstance()->DisplayErrorText("Test Vtk
Error Message");
45 static
void TestVtkLoggingWithAdapter()
48 <<
"Testing vtk logging with adapter class: Vtk logging messages should be logged as MITK logging messages.")
49 mitk::VtkLoggingAdapter::Initialize();
50 vtkOutputWindow::GetInstance()->DisplayText("Test Vtk
Info Message");
51 vtkOutputWindow::GetInstance()->DisplayDebugText("Test Vtk
Debug Message");
52 vtkOutputWindow::GetInstance()->DisplayGenericWarningText("Test Vtk Generic Warning Message");
53 vtkOutputWindow::GetInstance()->DisplayWarningText("Test Vtk Warning Message");
54 vtkOutputWindow::GetInstance()->DisplayErrorText("Test Vtk
Error Message");
58 static
void TestItkLoggingWithoutAdapter()
60 ItkLoggingTestClass::Pointer myItkLogger = ItkLoggingTestClass::New();
61 myItkLogger->TestItkWarningMessage();
64 static void TestItkLoggingWithAdapter()
67 ItkLoggingTestClass::Pointer myItkLogger = ItkLoggingTestClass::New();
68 myItkLogger->TestItkWarningMessage();
75 LoggingAdapterTestClass::TestVtkLoggingWithoutAdapter();
76 LoggingAdapterTestClass::TestVtkLoggingWithAdapter();
77 LoggingAdapterTestClass::TestItkLoggingWithoutAdapter();
78 LoggingAdapterTestClass::TestItkLoggingWithAdapter();
#define MITK_TEST_CONDITION_REQUIRED(COND, MSG)
int mitkLoggingAdapterTest(int, char *[])
DataCollection - Class to facilitate loading/accessing structured data.
section GeneralTestsDeprecatedOldTestingStyle Deprecated macros All tests with MITK_TEST_BEGIN()
#define MITK_TEST_OUTPUT(x)
Output some text.
#define mitkClassMacroItkParent(className, SuperClassName)
static void Initialize()
Initializes the logging adapter. Itk logging messages are redirected to MITK logging afterwards...