Commit 8e0db2f3 authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[MERGE]

parents f1bf82fb c87c571c
......@@ -25,6 +25,7 @@
#ifndef WLOADEREEGASCII_TEST_H
#define WLOADEREEGASCII_TEST_H
#include <ctime>
#include <string>
#include <cxxtest/TestSuite.h>
#include <boost/thread.hpp>
......@@ -51,7 +52,16 @@ public:
WLoaderEEGASCII eegASCIILoader( fileName, dataHandler );
boost::thread loaderThread( eegASCIILoader );
sleep( 3 );
std::clock_t startTime;
startTime = std::clock();
std::clock_t elapsedTime = 0;
while( dataHandler->getNumberOfSubjects() == 0 && ( elapsedTime / static_cast< double >( CLOCKS_PER_SEC ) ) < 4 )
{
elapsedTime = std::clock() - startTime;
}
// TODO(wiebel): we need to change this because loading, in the end,
// should not always increase the number of subjects.
TS_ASSERT_EQUALS( dataHandler->getNumberOfSubjects(), 1 );
......
......@@ -25,10 +25,12 @@
#ifndef WLOADERMANAGER_TEST_H
#define WLOADERMANAGER_TEST_H
#include <ctime>
#include <string>
#include <iostream>
#include <boost/shared_ptr.hpp>
#include <boost/timer.hpp>
#include <cxxtest/TestSuite.h>
......@@ -49,12 +51,21 @@ public:
void testLoad( void )
{
std::string fileName = "fixtures/scalar_signed_short.nii.gz";
std::cout << "Test loading of " << fileName << "." << std::endl;
std::cout << std::endl << "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
std::clock_t startTime;
startTime = std::clock();
std::clock_t elapsedTime = 0;
while( dataHandler->getNumberOfSubjects() == 0 && ( elapsedTime / static_cast< double >( CLOCKS_PER_SEC ) ) < 4 )
{
elapsedTime = std::clock() - startTime;
}
// TODO(wiebel): we need to change this because loading, in the end,
// should not always increase the number of subjects.
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