Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
adc10626
Commit
adc10626
authored
Sep 17, 2009
by
Mathias Goldau
Browse files
[FIX] forgot an if stmt, improved readablility of WLoaderManager_test.h
parent
5ade4ff6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
src/dataHandler/WLoaderManager.cpp
src/dataHandler/WLoaderManager.cpp
+7
-5
src/dataHandler/test/WLoaderManager_test.h
src/dataHandler/test/WLoaderManager_test.h
+2
-1
No files found.
src/dataHandler/WLoaderManager.cpp
View file @
adc10626
...
...
@@ -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
);
}
...
...
src/dataHandler/test/WLoaderManager_test.h
View file @
adc10626
...
...
@@ -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
);
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment