Import 2017-06-07 23:51:09: master 43217535

Author Committer Branch Timestamp Parent
lassoan lassoan master 2015-03-26 00:30:01 master 74807e1b
Changeset

BUG: Fixed silently failing qSlicerWidgetTest2

qSlicerWidgetTest2 had two important errors:

  1. The test actually failed

It could not load the input image, as reported on the dashboard:

http://slicer.cdash.org/testDetails.php?test=6130889&build=403273

ERROR: In ..........\Slicer-1\Libs\MRML\Core\vtkMRMLVolumeArchetypeStorageNode.cxx, line 367
vtkMRMLVolumeArchetypeStorageNode (0000000004D4BE20): ReadData: Cannot read file as a volume of type Volume[fullName = C:/D/N/Slicer-1-build/Slicer-build/Base/QTGUI/Testing/Cxx/share/MRML/Testing/TestData/fixed.nrrd]
Number of files listed in the node = 0.
File reader says it was able to read 0 files.
File reader used the archetype file name of C:/D/N/Slicer-1-build/Slicer-build/Base/QTGUI/Testing/Cxx/share/MRML/Testing/TestData/fixed.nrrd []

The problem was that no ITK image IOs were registered.
Fixed by adding ITKFactoryRegistration to the test.
Also added proper logging of ITK exception data in vtkMRMLVolumeArchetypeStorageNode.

  1. The test did not report the failure

The test just logged the error but nobody noticed (it was not reported as an error on the dashboard).

Fixed by using VTK output testing by adding these 3 lines of code:

#include <vtkTestingOutputWindow.h>
...
TESTING_OUTPUT_INIT;
...
TESTING_OUTPUT_ASSERT_WARNINGS_ERRORS(0);

Now if there is any warnings or error during the test then it returns with failure.

VTK output testing should be similarly added for more (probably all) tests.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@24112 3bd1e089-480b-0410-8dfb-8563597acbee

mod - Libs/MRML/Core/vtkMRMLVolumeArchetypeStorageNode.cxx Diff File
mod - Libs/MRML/Widgets/Testing/CMakeLists.txt Diff File
mod - Libs/MRML/Widgets/Testing/qMRMLSliceWidgetTest2.cxx Diff File