Fix use of uninitialized arrays.
gradient_checking_cost_function_test.cc was using arrays without initializing
them which triggers valgrind errors, and causes failures when built on the N900.
Thanks to Sebastian Koch for reporting the error and Markus Moll for pin pointing
the cause of the error.
Change-Id: Iee498969bb5026eb302ea2990edf189e70f97800
diff --git a/internal/ceres/gradient_checking_cost_function_test.cc b/internal/ceres/gradient_checking_cost_function_test.cc
index cde613b..58a49b9 100644
--- a/internal/ceres/gradient_checking_cost_function_test.cc
+++ b/internal/ceres/gradient_checking_cost_function_test.cc
@@ -340,7 +340,11 @@
}
TEST(GradientCheckingProblemImpl, ProblemDimensionsMatch) {
- double x[3], y[4], z[5], w[4];
+ // Parameter blocks with arbitrarily chosen initial values.
+ double x[] = {1.0, 2.0, 3.0};
+ double y[] = {4.0, 5.0, 6.0, 7.0};
+ double z[] = {8.0, 9.0, 10.0, 11.0, 12.0};
+ double w[] = {13.0, 14.0, 15.0, 16.0};
ProblemImpl problem_impl;
problem_impl.AddParameterBlock(x, 3);