Fix two segaults in test code.

Thanks to Sergey Popov for reporting this.

Change-Id: Ib5124a90fc42ae9d7295c04d51a5dd8d16250504
This commit is contained in:
Sameer Agarwal
2012-09-07 17:04:53 -07:00
committed by ceres-solver code review
parent ab8e2dc453
commit fba3844b43
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -818,8 +818,8 @@ class StaticEvaluateTest : public ::testing::Test {
expected_gradient,
expected_jacobian,
cost,
&residuals[0],
&gradient[0],
residuals.size() > 0 ? &residuals[0] : NULL,
gradient.size() > 0 ? &gradient[0] : NULL,
dense_jacobian.data());
}
@@ -119,7 +119,7 @@ TEST(LevenbergMarquardtStrategy, CorrectDiagonalToLinearSolver) {
jacobian(0,2) = 100.0;
double residual = 1.0;
double x[2];
double x[3];
DenseSparseMatrix dsm(jacobian);
TrustRegionStrategy::Options options;