2009-11-29 02:35:36 +08:00
|
|
|
/**
|
|
|
|
* @file testOrdering.cpp
|
|
|
|
* @author Alex Cunningham
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <boost/assign/std/list.hpp> // for operator +=
|
2010-01-19 03:11:22 +08:00
|
|
|
using namespace boost::assign;
|
|
|
|
|
2009-11-29 02:35:36 +08:00
|
|
|
#include <CppUnitLite/TestHarness.h>
|
2010-01-18 03:34:57 +08:00
|
|
|
|
2010-01-19 03:11:22 +08:00
|
|
|
// Magically turn strings into Symbols
|
2010-01-18 03:34:57 +08:00
|
|
|
#define GTSAM_MAGIC_KEY
|
|
|
|
|
2010-01-19 03:11:22 +08:00
|
|
|
#include "Ordering.h"
|
2010-01-17 02:01:16 +08:00
|
|
|
#include "pose2SLAM.h"
|
2010-01-14 15:56:03 +08:00
|
|
|
|
2009-11-29 02:35:36 +08:00
|
|
|
using namespace std;
|
|
|
|
using namespace gtsam;
|
|
|
|
|
2010-01-14 11:21:07 +08:00
|
|
|
/* ************************************************************************* */
|
2010-01-19 03:11:22 +08:00
|
|
|
TEST ( Ordering, subtract )
|
|
|
|
{
|
2009-11-29 02:35:36 +08:00
|
|
|
Ordering init, delta;
|
|
|
|
init += "a", "b", "c", "d", "e";
|
|
|
|
CHECK(assert_equal(init.subtract(delta), init));
|
|
|
|
|
|
|
|
delta += "b";
|
|
|
|
Ordering expected1;
|
|
|
|
expected1 += "a", "c", "d", "e";
|
|
|
|
CHECK(assert_equal(init.subtract(delta), expected1));
|
|
|
|
|
|
|
|
delta += "e";
|
|
|
|
Ordering expected2;
|
|
|
|
expected2 += "a", "c", "d";
|
|
|
|
CHECK(assert_equal(init.subtract(delta), expected2));
|
|
|
|
}
|
2010-01-19 03:11:22 +08:00
|
|
|
|
2009-11-29 02:35:36 +08:00
|
|
|
/* ************************************************************************* */
|
2010-01-19 03:11:22 +08:00
|
|
|
int main() {
|
|
|
|
TestResult tr;
|
|
|
|
return TestRegistry::runAllTests(tr);
|
|
|
|
}
|
2009-11-29 02:35:36 +08:00
|
|
|
/* ************************************************************************* */
|