Commit adc10626 authored by Mathias Goldau's avatar Mathias Goldau
Browse files

[FIX] forgot an if stmt, improved readablility of WLoaderManager_test.h

parent 5ade4ff6
......@@ -44,11 +44,13 @@ void WLoaderManager::load( std::string fileName, boost::shared_ptr< WDataHandler
if( suffix == ".nii" || suffix == ".gz" )
{
// enforce that a gzipped file is has also a "nii" sub suffix
boost::filesystem::path p( fileName );
p.replace_extension( "" );
suffix = getSuffix( p.string() );
assert( suffix == ".nii" && "currently only nii files may be gzipped" );
if( suffix == ".gz" ) // it may be a NIfTI file too
{
boost::filesystem::path p( fileName );
p.replace_extension( "" );
suffix = getSuffix( p.string() );
assert( suffix == ".nii" && "currently only nii files may be gzipped" );
}
WLoaderNIfTI niiLoader( fileName, dataHandler );
boost::thread loaderThread( niiLoader );
}
......
......@@ -50,12 +50,13 @@ public:
std::cout << "Test loading of " << fileName << "." << std::endl;
boost::shared_ptr< WDataHandler > dataHandler =
boost::shared_ptr< WDataHandler >( new WDataHandler() );
TS_ASSERT_EQUALS( dataHandler->getNumberOfSubjects(), 0 );
WLoaderManager testLoaderManager;
testLoaderManager.load( fileName, dataHandler );
sleep( 4 ); // we need this to allow the thread to terminate
// TODO(wiebel): we need to change this because loading, in the end,
// should not always increase the number of subjects.
TS_ASSERT( dataHandler->getNumberOfSubjects() );
TS_ASSERT_EQUALS( dataHandler->getNumberOfSubjects(), 1 );
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment