Skip to content

Commit d36dfc6

Browse files
N-Dekkerdzenanz
authored andcommitted
STYLE: Replace Fill(0.) with {} initializer for local variables in tests
Replaced `Fill(0.)`, `Fill(0.0)`, `Fill(0.0f)`, and `Fill(0u)` calls with `{}` initializers. Follow-up to pull request #4881 commit 569a8b6 "STYLE: Replace Fill(0) with {} initializer for local variables in tests"
1 parent 3463f2f commit d36dfc6

File tree

69 files changed

+85
-170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+85
-170
lines changed

Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterTest.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ itkImageToVTKImageFilterTest(int, char *[])
4848
origin[0] = -1.5;
4949
origin[1] = 0.222;
5050
origin[2] = 0;
51-
DirectionType direction;
52-
direction.Fill(0.0);
51+
DirectionType direction{};
5352
direction[0][1] = 1;
5453
direction[1][0] = -1;
5554
direction[2][2] = 0.7;

Modules/Core/Common/test/itkImageTest.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ class TestTransform
3131
OutputPointType
3232
TransformPoint(const InputPointType & inputPoint) const
3333
{
34-
OutputPointType outputPoint;
35-
outputPoint.Fill(0.0);
34+
OutputPointType outputPoint{};
3635
// if InputPoint Dimension < 2 then embed point in 2D space
3736
// else project the point to 2D space.
3837
for (unsigned int d = 0; d < std::min(inputPoint.GetPointDimension(), outputPoint.GetPointDimension()); ++d)

Modules/Core/Common/test/itkMatrixTest.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ itkMatrixTest(int, char *[])
3333

3434
using vnlVectorType = vnl_vector_fixed<NumericType, 3>;
3535

36-
MatrixType matrix;
37-
matrix.Fill(0.0);
36+
MatrixType matrix{};
3837
matrix.SetIdentity();
3938

4039
VectorType v1;

Modules/Core/ImageFunction/test/itkRayCastInterpolateImageFunctionTest.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ itkRayCastInterpolateImageFunctionTest(int itkNotUsed(argc), char * itkNotUsed(a
5454
image->SetRegions(region);
5555
image->Allocate();
5656

57-
PointType origin;
58-
origin.Fill(0.0);
57+
PointType origin{};
5958

6059
SpacingType spacing;
6160
spacing.Fill(1.0);

Modules/Core/Mesh/test/itkParametricSpaceToImageSpaceMeshFilterTest.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ InternalTest(int argc, char * argv[])
101101
imageIterator.GoToBegin();
102102

103103
using PointType = typename InputMeshType::PointType;
104-
PointType point;
105-
point.Fill(0.);
104+
PointType point{};
106105

107106
using PointDataContainer = typename InputMeshType::PointDataContainer;
108107
using PointDataContainerPointer = typename InputMeshType::PointDataContainerPointer;

Modules/Core/Mesh/test/itkSphereMeshSourceTest.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ itkSphereMeshSourceTest(int, char *[])
5454
// itk::Mesh<float>::PointsContainer::Iterator m_output = myoutput->Begin();
5555

5656
IPT * pt_ptr;
57-
IPT pt;
58-
pt.Fill(0.0);
57+
IPT pt{};
5958
pt_ptr = &pt;
6059

6160
for (int i = 0; i < 12; ++i)

Modules/Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ itkVTKPolyDataWriterTest02(int argc, char * argv[])
6464

6565
MeshType::Pointer myMesh = mySphereMeshSource->GetOutput();
6666

67-
PointType pt;
68-
pt.Fill(0.);
67+
PointType pt{};
6968

7069
bool testPassed = true;
7170

Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1.cxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1(int argc, char * argv[])
4343
using PointType = SphereMeshSourceType::PointType;
4444
using VectorType = SphereMeshSourceType::VectorType;
4545

46-
PointType center;
47-
center.Fill(0.0);
46+
PointType center{};
4847

4948
VectorType scale;
5049
scale.Fill(1.0);
@@ -62,8 +61,7 @@ itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1(int argc, char * argv[])
6261

6362
MeshType::Pointer myMesh = mySphereMeshSource->GetOutput();
6463

65-
PointType pt;
66-
pt.Fill(0.);
64+
PointType pt{};
6765

6866
myMesh->Print(std::cout);
6967

Modules/Core/SpatialObjects/test/itkGaussianSpatialObjectTest.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ itkGaussianSpatialObjectTest(int, char *[])
4141
myGaussian->SetSigmaInObjectSpace(sigma);
4242
ITK_TEST_SET_GET_VALUE(sigma, myGaussian->GetSigmaInObjectSpace());
4343

44-
GaussianType::PointType center;
45-
center.Fill(0.0);
44+
GaussianType::PointType center{};
4645
myGaussian->SetCenterInObjectSpace(center);
4746
ITK_TEST_SET_GET_VALUE(center, myGaussian->GetCenterInObjectSpace());
4847

Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest3.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ itkImageMaskSpatialObjectTest3(int, char *[])
5353

5454
ImageType::IndexType index{};
5555

56-
ImageType::DirectionType direction;
57-
direction.Fill(0.0);
56+
ImageType::DirectionType direction{};
5857
direction[0][1] = 1;
5958
direction[1][0] = 1;
6059
direction[2][2] = 1;

0 commit comments

Comments
 (0)