itkSyNImageRegistrationTest and itkBSplineSyNImageRegistrationTest pass without ever running a registration: an argument-count guard rejects the CMake-supplied argv, and the helper's return value is discarded so the failure is swallowed. Both complete in ~0.06 s in Release and Debug alike.
itkSyNImageRegistrationTest
Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationTest.cxx:112-118
PerformDisplacementFieldImageRegistration(int argc, char * argv[])
{
if (argc != 5)
{
std::cout << "ERROR: incorrect number of arguments" << std::endl;
return EXIT_FAILURE;
}
test/CMakeLists.txt:415-428 invokes the test with 7 arguments (test name, dimension, fixed, moving, output prefix, iterations, learning rate), so argc == 7 and the guard always fires.
The failure is then discarded — itkSyNImageRegistrationTest.cxx:373-380:
switch (std::stoi(argv[1]))
{
case 2:
PerformDisplacementFieldImageRegistration<2>(argc, argv); // return value ignored
break;
Observed output:
Name of Class = SyNImageRegistrationMethod
ERROR: incorrect number of arguments
Test finished.
1/1 Test #3193: itkSyNImageRegistrationTest ...... Passed 0.07 sec
itkBSplineSyNImageRegistrationTest
Same shape. itkBSplineSyNImageRegistrationTest.cxx:80 asserts ITK_TEST_EXPECT_TRUE(argc == 4) while test/CMakeLists.txt:431-443 supplies 7 arguments; the helper's return value is likewise discarded at line 376.
Passes in 0.06 s.
Impact and suggested fix
Only ITK_EXERCISE_BASIC_OBJECT_METHODS on the registration object actually executes. The SyN and B-spline SyN registration paths — multi-level optimization, displacement-field update, convergence — have no effective test coverage, and no baseline comparison is performed.
Fix has two parts, both needed:
- Correct the
argc guards to match the actual invocations (or correct the invocations).
- Propagate the helper's return value out of the
switch so a failure fails the test.
Part 2 should land regardless — without it, any future argument-handling drift is silent again. Once the registrations actually run, baselines will need to be established and the runtimes will no longer be ~0.06 s.
Found while investigating the Debug-mode failure of itkSimpleImageRegistrationTest{Float,Double} (separate issue: the #ifdef NDEBUG 1-iteration reduction combined with the removal of the Debug-specific .3 baseline in PR #6569).
itkSyNImageRegistrationTestanditkBSplineSyNImageRegistrationTestpass without ever running a registration: an argument-count guard rejects the CMake-supplied argv, and the helper's return value is discarded so the failure is swallowed. Both complete in ~0.06 s in Release and Debug alike.itkSyNImageRegistrationTest
Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationTest.cxx:112-118test/CMakeLists.txt:415-428invokes the test with 7 arguments (test name, dimension, fixed, moving, output prefix, iterations, learning rate), soargc == 7and the guard always fires.The failure is then discarded —
itkSyNImageRegistrationTest.cxx:373-380:Observed output:
itkBSplineSyNImageRegistrationTest
Same shape.
itkBSplineSyNImageRegistrationTest.cxx:80assertsITK_TEST_EXPECT_TRUE(argc == 4)whiletest/CMakeLists.txt:431-443supplies 7 arguments; the helper's return value is likewise discarded at line 376.Passes in 0.06 s.
Impact and suggested fix
Only
ITK_EXERCISE_BASIC_OBJECT_METHODSon the registration object actually executes. The SyN and B-spline SyN registration paths — multi-level optimization, displacement-field update, convergence — have no effective test coverage, and no baseline comparison is performed.Fix has two parts, both needed:
argcguards to match the actual invocations (or correct the invocations).switchso a failure fails the test.Part 2 should land regardless — without it, any future argument-handling drift is silent again. Once the registrations actually run, baselines will need to be established and the runtimes will no longer be ~0.06 s.
Found while investigating the Debug-mode failure of
itkSimpleImageRegistrationTest{Float,Double}(separate issue: the#ifdef NDEBUG1-iteration reduction combined with the removal of the Debug-specific.3baseline in PR #6569).