Fix tiny_solver_test Verify that the final cost is small enough instead of the norm of the residual vector. Change-Id: I9591d97d3e8f1c71067d99270967f1e593889843
diff --git a/internal/ceres/tiny_solver_test.cc b/internal/ceres/tiny_solver_test.cc index 747e20d..f92b186 100644 --- a/internal/ceres/tiny_solver_test.cc +++ b/internal/ceres/tiny_solver_test.cc
@@ -146,13 +146,11 @@ Vector x = x0; Vec2 residuals; f(x.data(), residuals.data(), NULL); - EXPECT_GT(residuals.norm(), 1e-10); + EXPECT_GT(residuals.squaredNorm() / 2.0, 1e-10); TinySolver<Function> solver; solver.Solve(f, &x); - - f(x.data(), residuals.data(), NULL); - EXPECT_NEAR(0.0, residuals.norm(), 1e-10); + EXPECT_NEAR(0.0, solver.summary.final_cost, 1e-10); } // A test case for when the cost function is statically sized.