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
This commit is contained in:
Sameer Agarwal
2012-07-11 11:15:25 -07:00
parent f44907f702
commit 451623a5a1
@@ -340,7 +340,11 @@ void ParameterBlocksAreEquivalent(const ParameterBlock* left,
}
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);