Skip to content

Commit

Permalink
STYLE: Do not Fill empty OutputVectorPixelType variables in test
Browse files Browse the repository at this point in the history
`OutputVectorPixelType` is an alias of `VariableLengthVector`, so its instances
are empty, when they are just default-constructed. An attempt to "Fill" such
empty objects has no effect at all.
  • Loading branch information
N-Dekker committed Oct 24, 2024
1 parent 7271903 commit 1e45e5a
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions Modules/Core/Transform/test/itkTransformTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ class TransformTestHelper : public Transform<TScalar, VInputDimension, VOutputDi
OutputVectorPixelType
TransformVector(const InputVectorPixelType & itkNotUsed(inputVector)) const override
{
OutputVectorPixelType outVector;
outVector.Fill(88.8);
return outVector;
return {};
}

using Superclass::TransformCovariantVector;
Expand All @@ -103,9 +101,7 @@ class TransformTestHelper : public Transform<TScalar, VInputDimension, VOutputDi
OutputVectorPixelType
TransformCovariantVector(const InputVectorPixelType & itkNotUsed(inputVector)) const override
{
OutputVectorPixelType outVector;
outVector.Fill(6.9);
return outVector;
return {};
}

using Superclass::TransformDiffusionTensor3D;
Expand All @@ -120,9 +116,7 @@ class TransformTestHelper : public Transform<TScalar, VInputDimension, VOutputDi
OutputVectorPixelType
TransformDiffusionTensor3D(const InputVectorPixelType & itkNotUsed(tensor)) const override
{
OutputVectorPixelType outTensor;
outTensor.Fill(29.1);
return outTensor;
return {};
}

using Superclass::TransformSymmetricSecondRankTensor;
Expand All @@ -137,9 +131,7 @@ class TransformTestHelper : public Transform<TScalar, VInputDimension, VOutputDi
OutputVectorPixelType
TransformSymmetricSecondRankTensor(const InputVectorPixelType & itkNotUsed(tensor)) const override
{
OutputVectorPixelType outTensor;
outTensor.Fill(55.9);
return outTensor;
return {};
}

void
Expand Down

0 comments on commit 1e45e5a

Please sign in to comment.