[opengtl-commits] [584] Shiva tester checked the output of generated/changed function |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/opengtl-commits Archives
]
Revision: 584
Author: cyrille
Date: 2009-03-05 18:54:45 +0100 (Thu, 05 Mar 2009)
Log Message:
-----------
Shiva tester checked the output of generated/changed function
Modified Paths:
--------------
trunk/OpenGTL/OpenShiva/tools/tester/ShivaTester.cpp
Modified: trunk/OpenGTL/OpenShiva/tools/tester/ShivaTester.cpp
===================================================================
--- trunk/OpenGTL/OpenShiva/tools/tester/ShivaTester.cpp 2009-03-05 17:53:47 UTC (rev 583)
+++ trunk/OpenGTL/OpenShiva/tools/tester/ShivaTester.cpp 2009-03-05 17:54:45 UTC (rev 584)
@@ -145,6 +145,7 @@
GTLCore::AbstractImage* resultImage = decoder->decode( resultFileName, ®ion, &errMsg );
GTLCore::Image image(region.width(), region.height(), resultImage->pixelDescription() );
std::list<GTLCore::AbstractImage*> images;
+ std::list<GTLCore::Region> inputDOD;
for( std::list< GTLCore::String >::iterator it = fileNames.begin();
it != fileNames.end(); ++it )
{
@@ -154,14 +155,39 @@
std::cerr << "Can't find decoder for " << *it << std::endl;
return EXIT_FAILURE;
}
- GTLCore::AbstractImage* image = decoder->decode( *it, 0, &errMsg );
+ GTLCore::Region region;
+ GTLCore::AbstractImage* image = decoder->decode( *it, ®ion, &errMsg );
if( not image )
{
std::cerr << "Can't read image " << *it << " : " << errMsg << std::endl;
return EXIT_FAILURE;
}
images.push_back( image );
+ inputDOD.push_back( region );
}
+ if( p.hasGeneratedFunction() )
+ {
+ GTLCore::Region gregion = p.generated();
+ if( gregion != region )
+ {
+ std::cerr << "Generated region (" << gregion << ") and result images are different (" << region << ")" << std::endl;
+ return EXIT_FAILURE;
+ }
+ }
+ if( p.hasChangedFunction() )
+ {
+ GTLCore::Region cregion;
+ int i = 0;
+ for( std::list<GTLCore::Region>::iterator it = inputDOD.begin(); it != inputDOD.end(); ++it, ++i)
+ {
+ cregion += p.changed( *it, i, inputDOD );
+ }
+ if( cregion != region )
+ {
+ std::cerr << "Changed region (" << cregion << ") and result images are different (" << region << ")" << std::endl;
+ return EXIT_FAILURE;
+ }
+ }
p.evaluatePixeles( region, images, &image );
int errorCount = image.compare( resultImage, region );
if( errorCount != 0 )