#include "mitkTestingMacros.h"#include "mitkToolManager.h"#include "mitkStandaloneDataStorage.h"#include "mitkCoreObjectFactory.h"#include "mitkAddContourTool.h"#include "mitkGlobalInteraction.h"Go to the source code of this file.
Classes | |
| class | mitkToolManagerTestClass |
Functions | |
| int | mitkToolManagerTest (int, char *[]) |
| int mitkToolManagerTest | ( | int | , |
| char * | [] | ||
| ) |
Definition at line 62 of file mitkToolManagerTest.cpp.
References mitk::GlobalInteraction::GetInstance(), MITK_TEST_BEGIN, MITK_TEST_CONDITION_REQUIRED, MITK_TEST_END, mitk::ToolManager::New(), mitk::StandaloneDataStorage::New(), mitkToolManagerTestClass::TestSetterMethods(), and mitkToolManagerTestClass::TestToolManagerWithTools().
{
// always start with this!
MITK_TEST_BEGIN("ToolManager")
// Global interaction must(!) be initialized if used
mitk::GlobalInteraction::GetInstance()->Initialize("global");
// instantiation
mitk::StandaloneDataStorage::Pointer dataStorage = mitk::StandaloneDataStorage::New();
mitk::ToolManager::Pointer toolManager = mitk::ToolManager::New(dataStorage.GetPointer());
// first test: did this work?
// using MITK_TEST_CONDITION_REQUIRED makes the test stop after failure, since
// it makes no sense to continue without an object.
MITK_TEST_CONDITION_REQUIRED(toolManager.IsNotNull(),"Testing instantiation")
// write your own tests here and use the macros from mitkTestingMacros.h !!!
// do not write to std::cout and do not return from this function yourself!
//mitkToolManagerTestClass::TestToolManagerWithOutTools(toolManager);
//now we add one tool
toolManager = mitk::ToolManager::New(dataStorage.GetPointer());
//start test with tool
mitkToolManagerTestClass::TestToolManagerWithTools(toolManager);
//now the setter methods
mitkToolManagerTestClass::TestSetterMethods(toolManager);
// always end with this!
MITK_TEST_END()
}
1.7.2