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: Improve style in miscellaneous tests #4203

Conversation

jhlegarreta
Copy link
Member

@jhlegarreta jhlegarreta commented Sep 4, 2023

  • STYLE: Increase consistency in test argument check message
  • STYLE: Conform to ITK style guidelines in test ending message
  • STYLE: Prefer using constexpr <type> over struct for image dimension
  • STYLE: Conform to ITK comment style for within-code comments (tests)
  • STYLE: Remove empty comment lines in tests
  • STYLE: Remove uninformative standard output message in itkHistogramTest
  • STYLE: Remove uninformative comments in tests
  • STYLE: Do not allow lonely std output endl statements in misc tests
  • STYLE: Increase consistency in newline character use in tests
  • STYLE: Remove blank lines in excess in miscellaneous tests

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:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering 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) area:Numerics Issues affecting the Numerics module labels Sep 4, 2023
Increase consistency in the missing argument check message, following
the ITK SW guide coding guidelines. Specifically, make the error message
be consistent.
Conform to ITK style guidelines in test ending message: add it where
missing and modify it where existing to match the ITK SWG module to
increase consistency.
@jhlegarreta jhlegarreta force-pushed the ImproveStyleInMiscellaneousTests2 branch 3 times, most recently from 9fd7044 to 33e3ef6 Compare September 5, 2023 02:05
Prefer declaring image dimensions as `constexpr <type>` over `struct` in
tests: a struct does not provide any particular advantage to host the
image dimensions.

Declare the type as an `unsigned int` and change the loop index
variables accordingly to avoid signed/unsiged comparison mismatch
warnings. Take advantage of the commit to limit the loop index
variables' scope to the loop.
Conform to ITK comment style for within code comments in tests: prefer
double forward slashes for within code comment blocks, and place the
comment blocks preferably immediately before the statemet they refer to.

Take advantage of the commit to use sentence cases in miscellaneous
comments.
Remove unnecessary and uninformative single-comment and empty comment
lines in tests.
Remove uninformative standard output message in `itkHistogramTest.cxx`.
Remove uninformative comments in tests.
Do not allow lonely `std::cout << std::endl` statements in miscellaneous
tests: move them to the preceding standard output message printing
statment.
Increase consistency in newline character use in tests: use `std::endl`
instead of `\n` to introduce new lines.

Remove `\n` characters in excess in miscellaneous output stream
messages.
Remove blank lines in excess in miscellaneous tests.
@jhlegarreta jhlegarreta force-pushed the ImproveStyleInMiscellaneousTests2 branch from 33e3ef6 to 603b67d Compare September 5, 2023 02:08
@dzenanz dzenanz merged commit 348e8cb into InsightSoftwareConsortium:master Sep 6, 2023
5 checks passed
@jhlegarreta jhlegarreta deleted the ImproveStyleInMiscellaneousTests2 branch September 6, 2023 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering 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.

2 participants