Skip to content

Remove Fill on empty variables, replace other Fill calls with itk::MakeFilled, in MeshIOTestHelper#4905

Merged
jhlegarreta merged 2 commits intoInsightSoftwareConsortium:masterfrom
N-Dekker:Replace-Fill-in-MeshIOTestHelper
Oct 27, 2024
Merged

Remove Fill on empty variables, replace other Fill calls with itk::MakeFilled, in MeshIOTestHelper#4905
jhlegarreta merged 2 commits intoInsightSoftwareConsortium:masterfrom
N-Dekker:Replace-Fill-in-MeshIOTestHelper

Conversation

@N-Dekker
Copy link
Copy Markdown
Contributor

Proposed style changes to itkMeshIOTestHelper.h:

An instance of `itk::Array`, `itk::VariableLengthVector`, or
`itk::VariableSizeMatrix` is empty, when it is just default-constructed. An
attempt to `Fill` such an empty object has no effect.

- Follow-up to pull request InsightSoftwareConsortium#4898
"Do not `Fill` default-constructed empty local variables in tests"
Replaced code of the form

    T var;
    var.Fill(x);

with `auto var = itk::MakeFilled<T>(x);`

- Follow-up to pull request InsightSoftwareConsortium#4891
"STYLE: Replace Fill calls with `auto var = itk::MakeFilled<T>` in tests"
@N-Dekker N-Dekker requested a review from jhlegarreta October 26, 2024 10:15
@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:IO Issues affecting the IO module labels Oct 26, 2024
Copy link
Copy Markdown
Member

@jhlegarreta jhlegarreta left a comment

Choose a reason for hiding this comment

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

So this is marked as a draft; I'd rather review this once it is ready for review.

@N-Dekker
Copy link
Copy Markdown
Contributor Author

@jhlegarreta I see your point 👍 Hereby I declare this pull request ready for review!

@N-Dekker N-Dekker marked this pull request as ready for review October 26, 2024 20:34
@jhlegarreta jhlegarreta merged commit 056a225 into InsightSoftwareConsortium:master Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:IO Issues affecting the IO module 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