Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F224
BDTest.patch
Public
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
schwarzt
Jun 3 2009, 5:10 PM
2009-06-03 17:10:20 (UTC+2)
Size
3 KB
Referenced Files
None
Subscribers
None
BDTest.patch
View Options
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt (revision 17557)
+++ CMakeLists.txt (working copy)
@@ -19,6 +19,7 @@
mitkImageDataItemTest.cpp
#mitkImageMapper2DTest.cpp
mitkImageTest.cpp
+ mitkBaseDataTest.cpp
#mitkImageToItkTest.cpp
mitkInteractorTest.cpp
mitkITKThreadingTest.cpp
Index: mitkBaseDataTest.cpp
===================================================================
--- mitkBaseDataTest.cpp (revision 0)
+++ mitkBaseDataTest.cpp (revision 0)
@@ -0,0 +1,102 @@
+/*=========================================================================
+
+Program: Medical Imaging & Interaction Toolkit
+Language: C++
+Date: $Date$
+Version: $Revision: 17230 $
+
+Copyright (c) German Cancer Research Center, Division of Medical and
+Biological Informatics. All rights reserved.
+See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
+
+This software is distributed WITHOUT ANY WARRANTY; without even
+the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
+
+
+#include "mitkBaseData.h"
+
+#include <fstream>
+
+int mitkBaseDataTest(int /*argc*/, char* /*argv*/[])
+{
+ mitk::BaseData::Pointer bd;
+ std::cout << "Testing mitk::BaseData::New(): ";
+ bd = mitk::BaseData::New();
+ if (bd.IsNull()) {
+ std::cout<<"[FAILED]"<<std::endl;
+ return EXIT_FAILURE;
+ }
+ else {
+ std::cout<<"[PASSED]"<<std::endl;
+ }
+
+ std::cout << "Testing time sliced geometry after New(): ";
+ mitk::TimeSlicedGeometry::Pointer tsg = bd->GetTimeSlicedGeometry();
+ if (tsg.IsNull()) {
+ std::cout<<"[FAILED]"<<std::endl;
+ return EXIT_FAILURE;
+ }
+ unsigned int ts = tsg->GetTimeSteps();
+ if(ts != 0)
+ {
+ std::cout<<"[FAILED]"<<std::endl;
+ return EXIT_FAILURE;
+ }
+ else {
+ std::cout<<"[PASSED]"<<std::endl;
+ }
+
+ std::cout << "Testing with initialized time sliced geometry: ";
+ bg->InitializeTimeSlicedGeometry(2);
+ tsg = bd->GetUpdatedTimeSlicedGeometry();
+ if (tsg.IsNull()) {
+ std::cout<<"[FAILED]"<<std::endl;
+ return EXIT_FAILURE;
+ }
+ unsigned int ts = tsg->GetTimeSteps();
+ if(ts != 2)
+ {
+ std::cout<<"[FAILED]"<<std::endl;
+ return EXIT_FAILURE;
+ }
+ else {
+ std::cout<<"[PASSED]"<<std::endl;
+ }
+
+ std::cout << "Testing Set and Get methods for property lists: ";
+ mitk::PropertyList::Pointer pl = mitk::PropertyList::New();
+ pl->SetBoolProperty("Test", true);
+ bd->SetPropertyList(pl);
+ pl = bd->GetPropertyList();
+ if( pl.IsNull() || !(pl->GetProperty("Test")) || (pl->GetBoolProperty("Test")!=true) ) {
+ std::cout<<"[FAILED]"<<std::endl;
+ return EXIT_FAILURE;
+ }
+ else {
+ std::cout<<"[PASSED]"<<std::endl;
+ }
+
+ std::cout << "Testing CopyInformation method: ";
+ mitk::BaseData::Pointer nbd = mitk::BaseData::New();
+ nbd->CopyInformation(bd);
+
+ std::cout << "Testing copied time sliced geometry... ";
+ tsg = nbd->GetTimeSlicedGeometry();
+ if (tsg.IsNull() || (tsg->GetTimeSteps() != 2) ) {
+ std::cout<<"[FAILED]"<<std::endl;
+ return EXIT_FAILURE;
+ }
+
+ std::cout << "Testing copied property list... ";
+ pl = nbd->GetPropertyList();
+ if( pl.IsNull() || !(pl->GetProperty("Test")) || (pl->GetBoolProperty("Test")!=true) ) {
+ std::cout<<"[FAILED]"<<std::endl;
+ return EXIT_FAILURE;
+ }
+
+ std::cout<<"[TEST DONE]"<<std::endl;
+ return EXIT_SUCCESS;
+}
Property changes on: mitkBaseDataTest.cpp
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision"
Added: svn:eol-style
+ native
File Metadata
Details
Attached
Mime Type
application/octet-stream
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
215
Default Alt Text
BDTest.patch (3 KB)
Attached To
Mode
No data available.
Event Timeline
•
schwarzt
added a comment.
Jun 3 2009, 5:10 PM
2009-06-03 17:10:20 (UTC+2)
Comment Actions
Basic test for mitkBaseData class.
Log In to Comment