Page MenuHomePhabricator

[Dashboard] dartclient failed to pass mitkBaseDataTest
Closed, ResolvedPublic

Assigned To
None
Authored By
gergel
Apr 30 2010, 10:26 AM
Referenced Files
F520: macpatch.patch
Sep 28 2010, 4:57 PM
F519: propertylistmac.patch
Sep 17 2010, 7:08 PM

Event Timeline

The test is failing in:

Check if base property is set correctly in the property list! [FAILED]

In /Users/dartclient/mitk/nightly/src-public/Core/Code/Testing/mitkBaseDataTest.cpp, line 97: baseDataImpl->GetPropertyList()->GetBoolProperty("visibility", value) == true : [FAILED]

The source of the bug could be the MITK_TEST_CONDITION() macro, since replacing

MITK_TEST_CONDITION(baseDataImpl->GetPropertyList() == propertyList, "...");

by

std::cout<<"Testing property equality ";
if ( baseDataImpl->GetPropertyList() != propertyList )
{

std::cout<<"[FAILED]"<<std::endl;
return EXIT_FAILURE;

}
std::cout<<"[PASSED]"<<std::endl;

results into "[PASSED]".

patch for making propertylist run on macs

I assume the bug lies somewhere in the gcc-toolchain on the Mac.

The bug is:

Dynamic casting from a BaseProperty to GenericProperty<bool> generates an invalid NULL.

However:

It works, when dynamic casting from BaseProperty to BoolProperty, which in fact i s only a typedef of GenericProperty<bool>.

So its clearly a compiler bug we cant influence for now.

This affects almost anything that is using the GenericProperty<T> template,
including mitk::PropertyList::GetPropertyValue<T>() on
which
mitk::PropertyList::GetBoolProperty
mitk::PropertyList::GetFloatProperty
mitk::PropertyList::GetIntProperty
are based on.

I added a patch where i rewrote these methods to use the respective typedefs instead of the templated method, so that the test passes on mac.

this patch fixes this bug and 3895.

the problem lies again in using templates among dlls.

just using the inlined version instead of the template specialisations
(like its already on windows) all behaves like excepted.

this increases code by a negligible amount,

but its compatible to all compilers

(In reply to comment #6)

Created attachment 700 [details]
CleanFix for the MacTestBug

this patch fixes this bug and 3895.

the problem lies again in using templates among dlls.

just using the inlined version instead of the template specialisations
(like its already on windows) all behaves like excepted.

this increases code by a negligible amount,

but its compatible to all compilers

Changes are ok, but actually they leave the possibility open to call GetProperty<T> manually. You could change the method and issue a warning to MITK_ERROR protected by some #ifdef check for MacOS. This warning should at least alert developers that it is not save to call this method.
Alternative: try to mark this method as deprecated for the compiler on MacOS. See http://www.delorie.com/gnu/docs/gcc/gcc_55.html

[SVN revision 26439]
FIX (#3893): fixing failing tests on MAC

[SVN revision 26494]
FIX (#3893): merging fixes for this bug back to trunk

Merging the fixes for this bug and T3895 back to trunk as I accidentally commited them to 3M3 1.1 branch. Sorry for the merge-infos!

[SVN revision 26496]
COMP (#3893): added missing include

Testing bugs are part of their respective modules -> changing component to other, please assign appropriate component.