-
-
Notifications
You must be signed in to change notification settings - Fork 726
Extend the use of some testing macros to examples #1275
Copy link
Copy link
Open
Labels
status:Use_Milestone_BacklogUse "Backlog" milestone instead of label for issues without a fixed deadlineUse "Backlog" milestone instead of label for issues without a fixed deadlinetype:DesignImprovement in the design of a given areaImprovement in the design of a given area
Metadata
Metadata
Assignees
Labels
status:Use_Milestone_BacklogUse "Backlog" milestone instead of label for issues without a fixed deadlineUse "Backlog" milestone instead of label for issues without a fixed deadlinetype:DesignImprovement in the design of a given areaImprovement in the design of a given area
Description
Derived from this PR to fix a bug it would may be useful to be able to use the
ITK_TRY_EXPECT_NO_EXCEPTIONmacro also in the ITK Examples.The macro is currently defined in
itkTestingMacros.h, and is virtually never used in the ITK code base or Examples because may be including [itkTestingMacros.h] in such files is counter-intuitive indeed.So may be it should be moved to elsewhere, since in reality,
try/catchblocks are not really limited to tests and examples.It would avoid writing boilerplate code, and making the exception messages consistent.
Impact analysis
It would allow to avoid bugs such as the one mentioned, would make the code more consistent, have less boilerplate code, and no downsides to it can are foreseen.
Expected behavior
Be able to call
macros from the ITK code base or Examples including some header file other than
itkTestingMacros.h, which seems counter-intuitive.Actual behavior
The
ITK_TRY_EXPECT_NO_EXCEPTIONmacros is virtually never used in the ITK code base or the Examples.Versions
masterAdditional Information
One may wonder what to do with
TRY_EXPECT_EXCEPTIONthen, since that is really intended for tests.Naming may need to be taken care of. Almost all macros in itkTestingMacros have the prefix
TEST. And a few do not.Related to #1273.