ENH: Increase coverage#2286
ENH: Increase coverage#2286jhlegarreta wants to merge 5 commits intoInsightSoftwareConsortium:masterfrom
Conversation
dzenanz
left a comment
There was a problem hiding this comment.
Looks good aside from a few compile errors on *nix:
https://open.cdash.org/viewBuildError.php?buildid=7030130
b68d723 to
2035d94
Compare
|
Thanks for the review @dzenanz . I push forced the fix. However, I still need to add another commit which will contain the largest part of changes to the test files. Given the number of files I'm changing and the diversity of the commits I wanted to open a PR and test early to ensure that virtually each commit's builds' pass. So WIP/draft for now. |
9147f92 to
e31f003
Compare
| typename CorrecterType::Pointer correcter = CorrecterType::New(); | ||
| correcter->SetSplineOrder(3); | ||
|
|
||
| EXERCISE_BASIC_OBJECT_METHODS(correcter, N4BiasFieldCorrectionImageFilter, ImageToImageFilter); |
There was a problem hiding this comment.
CDash is failing here:
https://open.cdash.org/viewBuildError.php?buildid=7035321
The Superclass is correctly declared.
Not sure if the class is missing the ITK_TEMPLATE_EXPORT macro.
There was a problem hiding this comment.
Still being reported here after this comment was addressed in 155b729. All three related tests passing locally on my Windows/VS setup.
There was a problem hiding this comment.
Latest commit fixes this, but exposes some other issues (e.g. protected member access from test).
There was a problem hiding this comment.
OK, I see. Thanks for catching this ! Now, as you say, it is confusing that this has worked so far for the rest of the classes. I think it deserves some investigation. I am reopening the conversation until we are able to find a convincing explanation. Thanks for your patience @dzenanz .
There was a problem hiding this comment.
Update: so the error is still present despite 107d1cc.
Reading ITK_EXERCISE_BASIC_OBJECT_METHODS again with more care, I'd revert 107d1cc: the version in master is correct: the method's Class and SuperClass arguments are used in here and here as strings to compare to the ones the object retrieves. I grant it might be clearer to rename the arguments to ClassName and SuperclassName in a separate PR to avoid confusion with capitals.
But the call object->Superclass is actually calling the instance of the object's parent class to retrieve the latter's NameOfClass, which is legal and the original intent.
So there is something else with itk::N4BiasFieldCorrectionImageFilter/the issue is not in the definition of ITK_EXERCISE_BASIC_OBJECT_METHODS.
Even more intriguing, the test is passing in my local build (Windows 10/VS 2015/default CMake flags). Can't think of where to continue looking (ITK_TEMPLATE_EXPORT, CMakeLists.txt, CMake flags?). Obviously, adding explicitly the #include itkImageToImageFilter.h does not make a difference in my local environment, and not sure why that would be needed since itkN4BiasFieldCorrectionImageFilter.h does include it.
@thewtex @blowekamp @N-Dekker @hjmjohnson any help is appreciated.
|
Some failures are still expected until some aspects are better understood, and they will definitely benefit from reviews. I'll revise my notes concerning them and post the questions when I get some time. |
8b6d4fe to
155b729
Compare
|
A few notes:
|
|
I compiled this branch on my computer, and fixed some compile errors. |
|
Can you rebase on current master? The macro parameter rename PR was merged. |
Fix Superclass name in RTTI macro.
Remove duplicate include file.
Print all member variables. Take advantage of the commit to - Use the `itk::NumericTraits::PrintType` definition, the `print_helper`-enabled overload for array-like types, and the `itkPrintSelfObjectMacro` macro to improve how the ivars and objects that can be null pointers are printed. - Print the member variables in the same order they were declared for the sake of consistency. - Print the member variable names verbatim to conform to the ITK SW Guide.
…ation` Use `itkBooleanMacro` to set `ImageSpacing` and `InterpolateSurfaceLocation` boolean member variable values to On/Off: - Deprecate `Set*(On/Off)` signatures. - Test the methods.
Increase the code coverage: - Add new unit tests for untested classes, including the corresponding baseline hash files. - Exercise the basic object methods using the `ITK_EXERCISE_BASIC_OBJECT_METHODS` macro. - Test the Set/Get methods using the `ITK_TEST_SET_GET_VALUE` macro. - Test the boolean ivars using the `ITK_TEST_SET_GET_BOOLEAN` macro. - Add the corresponding test arguments to the appropriate `CMakeLists.txt` test driver command. - Remove the global `try/catch` blocks and use the `ITK_TRY_EXPECT_NO_EXCEPTION` macro around the statement that is liable to throw an exception to avoid boilerplate code and to improve readability. - Test the exceptions. - Remove explicit calls to the `Print` method and rely on the basic method exercising macro call. - Improve slightly the test style to make them more consistent (e.g. input argument checking, test finishing message, make the types and variables dwell closer to the place where they are instantiated, define the image dimension as a constant; use aliases for the pixel types, etc.). - Remove unnecessary print messages.
a581f2a to
c19e8fa
Compare
|
c19e8fa rebased on |
|
Interestingly enough, only Linux reports the build failures related to the Also, the Suggestions are welcome. Thanks. The rest of the failures/warnings are expected/will ask about them once we are able to find a solution to the above. |
|
As this is a large improvement, maybe comment out the problematic tests now (or remove them) for now? After this is merged, start a new PR with just those two things being added? That will make it easier for others to pitch in. This 2500 line change is enough to discourage many from looking at it 😄 |
|
I inadvertently closed the PR. Sorry. |
|
Opened PR #2327 with the same contents and having addressed the latest comments. |
Improvements concerning testing and a few related enhancements:
Superclassname.itkBooleanMacroto set the boolean ivar values to On/Off.PR Checklist