From 655f9eddb770a24416ffeab520d9b8926b55f393 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Mon, 16 Dec 2013 21:55:33 +0000 Subject: [PATCH] Fixed unit tests for built-in comma initiailizer --- gtsam/base/tests/testLieMatrix.cpp | 2 +- gtsam/base/tests/testMatrix.cpp | 2 +- gtsam/base/tests/testVector.cpp | 14 ++++++-------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/gtsam/base/tests/testLieMatrix.cpp b/gtsam/base/tests/testLieMatrix.cpp index 6f30f0378..b21756dc4 100644 --- a/gtsam/base/tests/testLieMatrix.cpp +++ b/gtsam/base/tests/testLieMatrix.cpp @@ -62,7 +62,7 @@ TEST(LieMatrix, retract) { EXPECT(assert_equal(expectedUpdate, actualUpdate)); - Vector expectedLogmap = (Vector() << 1, 2, 3, 4); + Vector expectedLogmap = (Vector(4) << 1, 2, 3, 4); Vector actualLogmap = LieMatrix::Logmap(LieMatrix(2,2, 1.0, 2.0, 3.0, 4.0)); EXPECT(assert_equal(expectedLogmap, actualLogmap)); } diff --git a/gtsam/base/tests/testMatrix.cpp b/gtsam/base/tests/testMatrix.cpp index 84d812489..34502ba99 100644 --- a/gtsam/base/tests/testMatrix.cpp +++ b/gtsam/base/tests/testMatrix.cpp @@ -58,7 +58,7 @@ TEST( matrix, constructor_vector ) /* ************************************************************************* */ TEST( matrix, Matrix_ ) { - Matrix A = (Matrix(2, 2) << -5.0, 3.0, 00.0, -5.0); + Matrix A = (Matrix(2, 2) << -5.0, 3.0, 0.0, -5.0); Matrix B(2, 2); B(0, 0) = -5; B(0, 1) = 3; diff --git a/gtsam/base/tests/testVector.cpp b/gtsam/base/tests/testVector.cpp index 9a01b4d68..fc2b7a266 100644 --- a/gtsam/base/tests/testVector.cpp +++ b/gtsam/base/tests/testVector.cpp @@ -58,20 +58,18 @@ TEST( TestVector, special_comma_initializer) Vector actual1 = (Vector(3) << 1, 2, 3); Vector actual2((Vector(3) << 1, 2, 3)); - Vector actual3 = (Vector() << 1, 2, 3); - Vector subvec1 = (Vector() << 2, 3); - Vector actual4 = (Vector() << 1, subvec1); + Vector subvec1 = (Vector(2) << 2, 3); + Vector actual4 = (Vector(3) << 1, subvec1); - Vector subvec2 = (Vector() << 1, 2); - Vector actual5 = (Vector() << subvec2, 3); + Vector subvec2 = (Vector(2) << 1, 2); + Vector actual5 = (Vector(3) << subvec2, 3); - Vector actual6 = testFcn1((Vector() << 1, 2, 3)); - Vector actual7 = testFcn2((Vector() << 1, 2, 3)); + Vector actual6 = testFcn1((Vector(3) << 1, 2, 3)); + Vector actual7 = testFcn2((Vector(3) << 1, 2, 3)); EXPECT(assert_equal(expected, actual1)); EXPECT(assert_equal(expected, actual2)); - EXPECT(assert_equal(expected, actual3)); EXPECT(assert_equal(expected, actual4)); EXPECT(assert_equal(expected, actual5)); EXPECT(assert_equal(expected, actual6));