-
-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STYLE: Improve miscellaneous tests' style #4179
STYLE: Improve miscellaneous tests' style #4179
Conversation
502d776
to
b8f69dc
Compare
|
||
|
||
expander->ResetPipeline(); | ||
expander->SetInterpolator(interpolator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is weird that I had to add these two lines after the call to update the filter. The previous commit 10b5e6a produced a test failure:
https://open.cdash.org/viewTest.php?onlyfailed&buildid=8953052
It is unclear to me the reason of such failure, despite the test completing its instructions. Even more so this being a seemingly harmless style change. Any thoughts?
Modules/Filtering/ImageIntensity/test/itkVectorExpandImageFilterTest.cxx
Show resolved
Hide resolved
b8f69dc
to
3a21783
Compare
Declare variables close to where they are used in tests and initialize them at declaration.
Declare and use image dimensionality as a constant expression in miscellaneous tests instead of hard-coding the value across different statements.
Do not declare a test status variable that is only used once: prefer using directly the appropriate return value.
751bca2
to
e14a731
Compare
e14a731
to
4a1495a
Compare
d2c797a
to
c179ce3
Compare
Allow `itkCellInterfaceTest` to run as long as possible: store the check status value in a variable and return such value at the end of the test. Conform to the ITK SWG guidelines by doing so.
Use exception checking macros in `itkVectorExpandImageFilterTest.cxx`: - Use the `ITK_TRY_EXPECT_EXCEPTION` macro to check expected exceptions when updating filters in lieu of `try/catch` blocks for the sake of readability and compactness, and to save typing/avoid boilerplate code. - Only place the code that might raise exceptions within the macro. - Change the test status variable type to accomodate for the changes above.
Prefer setting the input once all ivars have been set in `itkPatchBasedDenoisingImageFilterDefaultTest.cxx`.
c179ce3
to
bdab6cf
Compare
constexpr
itkCellInterfaceTest
to run as long as possiblePR Checklist