Skip to content
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: Use exception checking macros in tests #4147

Conversation

jhlegarreta
Copy link
Member

Use exception checking macros in tests:

  • Use ITK_TRY_EXPECT_NO_EXCEPTION and ITK_TRY_EXPECT_EXCEPTION macros 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.

PR Checklist

@github-actions github-actions bot added type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Registration Issues affecting the Registration module type:Style Style changes: no logic impact (indentation, comments, naming) labels Aug 8, 2023
@jhlegarreta jhlegarreta force-pushed the UseExceptionCheckingMacrosInTests branch from 5f3f7e7 to 90607d7 Compare August 8, 2023 02:46
@github-actions github-actions bot added area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module area:Video Issues affecting the Video module area:Numerics Issues affecting the Numerics module labels Aug 8, 2023
Copy link
Member

@thewtex thewtex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@jhlegarreta jhlegarreta force-pushed the UseExceptionCheckingMacrosInTests branch from 90607d7 to d0c0f32 Compare August 8, 2023 12:52
Use exception checking macros in tests:
- Use `ITK_TRY_EXPECT_NO_EXCEPTION` and `ITK_TRY_EXPECT_EXCEPTION`
  macros 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.
@jhlegarreta jhlegarreta force-pushed the UseExceptionCheckingMacrosInTests branch from d0c0f32 to 2038fd7 Compare August 8, 2023 12:54
Copy link
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good on a glance.

@jhlegarreta jhlegarreta merged commit 4e9e584 into InsightSoftwareConsortium:master Aug 8, 2023
5 checks passed
@jhlegarreta jhlegarreta deleted the UseExceptionCheckingMacrosInTests branch August 8, 2023 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module area:Numerics Issues affecting the Numerics module area:Registration Issues affecting the Registration module area:Video Issues affecting the Video module type:Style Style changes: no logic impact (indentation, comments, naming) type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants