diff --git a/Core/Code/Testing/mitkLevelWindowManagerTest.cpp b/Core/Code/Testing/mitkLevelWindowManagerTest.cpp index a845b2ca55..a487f0f810 100644 --- a/Core/Code/Testing/mitkLevelWindowManagerTest.cpp +++ b/Core/Code/Testing/mitkLevelWindowManagerTest.cpp @@ -1,97 +1,109 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkLevelWindowManager.h" #include "mitkStandaloneDataStorage.h" +#include int mitkLevelWindowManagerTest(int, char* []) { + MITK_TEST_BEGIN("mitkLevelWindowManager"); + mitk::LevelWindowManager::Pointer manager; - std::cout << "Testing mitk::LevelWindowManager::New(): "; manager = mitk::LevelWindowManager::New(); - if (manager.IsNull()) - { - std::cout<<"[FAILED]"<SetDataStorage(ds); - std::cout<<"[PASSED]"<SetDataStorage(ds); + } + catch(std::exception e) + { + success = false; + MITK_ERROR << "Exception: " << e.what(); + } + MITK_TEST_CONDITION(success,"Testing mitk::LevelWindowManager SetDataStorage "); - std::cout << "Testing mitk::LevelWindowManager GetDataStorage "; - if (ds != manager->GetDataStorage()) - { - std::cout<<"[FAILED]"<GetDataStorage(),"Testing mitk::LevelWindowManager GetDataStorage "); - std::cout << "Testing mitk::LevelWindowManager SetLevelWindowProperty "; - mitk::LevelWindowProperty::Pointer levelWindowProperty = mitk::LevelWindowProperty::New(); - manager->SetLevelWindowProperty(levelWindowProperty); - std::cout<<"[PASSED]"<SetLevelWindowProperty(levelWindowProperty); + } + catch(mitk::Exception e) + { + success = true; + } + + MITK_TEST_CONDITION(success,"Testing mitk::LevelWindowManager SetLevelWindowProperty with invalid parameter"); + + +/* std::cout << "Testing mitk::LevelWindowManager GetLevelWindowProperty "; if (levelWindowProperty != manager->GetLevelWindowProperty()) { std::cout<<"[FAILED]"<isAutoTopMost()) { std::cout<<"[FAILED]"<GetLevelWindow(); std::cout<<"[PASSED]"<SetLevelWindow(levelWindow); std::cout<<"[PASSED]"<SetAutoTopMostImage(true); std::cout<<"[PASSED]"<isAutoTopMost())) { std::cout<<"[FAILED]"<