From f7647721067344bf0cbc96baf480a253dc190f48 Mon Sep 17 00:00:00 2001 From: Manohar Paluri Date: Wed, 9 Dec 2009 15:25:50 +0000 Subject: [PATCH] added getOrdering unit test --- cpp/testNonlinearFactorGraph.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/cpp/testNonlinearFactorGraph.cpp b/cpp/testNonlinearFactorGraph.cpp index 69e06806a..7e27cb39e 100644 --- a/cpp/testNonlinearFactorGraph.cpp +++ b/cpp/testNonlinearFactorGraph.cpp @@ -10,6 +10,9 @@ #include using namespace std; +#include +using namespace boost::assign; + #include #include "Matrix.h" @@ -22,7 +25,6 @@ using namespace gtsam; /* ************************************************************************* */ TEST( ExampleNonlinearFactorGraph, equals ) { - ExampleNonlinearFactorGraph fg = createNonlinearFactorGraph(); ExampleNonlinearFactorGraph fg2 = createNonlinearFactorGraph(); CHECK( fg.equals(fg2) ); @@ -32,7 +34,6 @@ TEST( ExampleNonlinearFactorGraph, equals ) TEST( ExampleNonlinearFactorGraph, error ) { ExampleNonlinearFactorGraph fg = createNonlinearFactorGraph(); - VectorConfig c1 = createConfig(); double actual1 = fg.error(c1); DOUBLES_EQUAL( 0.0, actual1, 1e-9 ); @@ -42,6 +43,16 @@ TEST( ExampleNonlinearFactorGraph, error ) DOUBLES_EQUAL( 5.625, actual2, 1e-9 ); } +/* ************************************************************************* */ +TEST( ExampleNonlinearFactorGraph, GET_ORDERING) +{ + Ordering expected; + expected += "l1","x1","x2"; + ExampleNonlinearFactorGraph nlfg = createNonlinearFactorGraph(); + Ordering actual = nlfg.getOrdering(); + CHECK(assert_equal(expected,actual)); +} + /* ************************************************************************* */ TEST( ExampleNonlinearFactorGraph, probPrime ) {