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 "mitkLevelWindowManager.h"
00019 #include "mitkStandaloneDataStorage.h"
00020
00021 int mitkLevelWindowManagerTest(int, char* [])
00022 {
00023 mitk::LevelWindowManager::Pointer manager;
00024 std::cout << "Testing mitk::LevelWindowManager::New(): ";
00025 manager = mitk::LevelWindowManager::New();
00026 if (manager.IsNull())
00027 {
00028 std::cout<<"[FAILED]"<<std::endl;
00029 return EXIT_FAILURE;
00030 }
00031 std::cout<<"[PASSED]"<<std::endl;
00032
00033 std::cout << "Creating DataStorage: ";
00034 mitk::StandaloneDataStorage::Pointer ds = mitk::StandaloneDataStorage::New();
00035 std::cout<<"[PASSED]"<<std::endl;
00036
00037 std::cout << "Testing mitk::LevelWindowManager SetDataStorage ";
00038 manager->SetDataStorage(ds);
00039 std::cout<<"[PASSED]"<<std::endl;
00040
00041 std::cout << "Testing mitk::LevelWindowManager GetDataStorage ";
00042 if (ds != manager->GetDataStorage())
00043 {
00044 std::cout<<"[FAILED]"<<std::endl;
00045 return EXIT_FAILURE;
00046 }
00047 std::cout<<"[PASSED]"<<std::endl;
00048
00049 std::cout << "Testing mitk::LevelWindowManager SetLevelWindowProperty ";
00050 mitk::LevelWindowProperty::Pointer levelWindowProperty = mitk::LevelWindowProperty::New();
00051
00052 manager->SetLevelWindowProperty(levelWindowProperty);
00053 std::cout<<"[PASSED]"<<std::endl;
00054 std::cout << "Testing mitk::LevelWindowManager GetLevelWindowProperty ";
00055 if (levelWindowProperty != manager->GetLevelWindowProperty())
00056 {
00057 std::cout<<"[FAILED]"<<std::endl;
00058 return EXIT_FAILURE;
00059 }
00060 std::cout<<"[PASSED]"<<std::endl;
00061 std::cout << "Testing mitk::LevelWindowManager isAutoTopMost ";
00062 if (manager->isAutoTopMost())
00063 {
00064 std::cout<<"[FAILED]"<<std::endl;
00065 return EXIT_FAILURE;
00066 }
00067 std::cout<<"[PASSED]"<<std::endl;
00068
00069 std::cout << "Testing mitk::LevelWindowManager GetLevelWindow ";
00070 try
00071 {
00072 const mitk::LevelWindow levelWindow = manager->GetLevelWindow();
00073 std::cout<<"[PASSED]"<<std::endl;
00074
00075 std::cout << "Testing mitk::LevelWindowManager SetLevelWindow ";
00076 manager->SetLevelWindow(levelWindow);
00077 std::cout<<"[PASSED]"<<std::endl;
00078 }
00079 catch (...)
00080 {
00081 std::cout<<"[FAILED]"<<std::endl;
00082 return EXIT_FAILURE;
00083 }
00084
00085 std::cout << "Testing mitk::LevelWindowManager SetAutoTopMostImage ";
00086 manager->SetAutoTopMostImage(true);
00087 std::cout<<"[PASSED]"<<std::endl;
00088 std::cout << "Testing mitk::LevelWindowManager isAutoTopMost ";
00089 if (!(manager->isAutoTopMost()))
00090 {
00091 std::cout<<"[FAILED]"<<std::endl;
00092 return EXIT_FAILURE;
00093 }
00094 std::cout<<"[PASSED]"<<std::endl;
00095
00096 std::cout<<"[TEST DONE]"<<std::endl;
00097 return EXIT_SUCCESS;
00098 }