Skip to content

Commit

Permalink
BUG: Initialize itk::Array variable values in test
Browse files Browse the repository at this point in the history
Initialize `itk::Array` variable values in
MultiResolutionImageRegistrationMethod.

Fixes:
```
UMC ==17365== Conditional jump or move depends on uninitialised value(s)
==17365==    at 0x6018484:
vnl_vector::operator_eq(vnl_vector const&) const (vnl_vector.hxx:757)
==17365==    by 0x2D1510:
vnl_vector::operator!=(vnl_vector const&) const (vnl_vector.h:431)
==17365==    by 0x3C92C7:
itk::MultiResolutionImageRegistrationMethod, itk::Image >
::SetInitialTransformParametersOfNextLevel(itk::OptimizerParameters)
(itkMultiResolutionImageRegistrationMethod.h:200)
==17365==    by 0x613AC5:
itkMultiResolutionImageRegistrationMethodTest(int, char**)
(itkMultiResolutionImageRegistrationMethodTest.cxx:139)
==17365==    by 0x2C10E7:
main (ITKRegistrationCommonTestDriver.cxx:417)
```

Raised for example in:
https://open.cdash.org/viewDynamicAnalysisFile.php?id=9067993
  • Loading branch information
jhlegarreta authored and hjmjohnson committed Jan 16, 2022
1 parent bd55ef3 commit 06d5ed1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ itkMultiResolutionImageRegistrationMethodTest(int, char *[])
registration->SetInitialTransformParameters(initialParameters);
ITK_TEST_SET_GET_VALUE(initialParameters, registration->GetInitialTransformParameters());

ParametersType initialTransformParametersOfNextLevel(1);
typename ParametersType::ValueType initialTransformParametersOfNextLevelVal(0.0);
ParametersType initialTransformParametersOfNextLevel(1, initialTransformParametersOfNextLevelVal);
registration->SetInitialTransformParametersOfNextLevel(initialTransformParametersOfNextLevel);
ITK_TEST_SET_GET_VALUE(initialTransformParametersOfNextLevel,
registration->GetInitialTransformParametersOfNextLevel());
Expand Down

0 comments on commit 06d5ed1

Please sign in to comment.