Slight refactor of tests, added (commented out) dynamic test

release/4.3a0
dellaert 2015-05-03 20:46:15 -07:00
parent 11de86cc1e
commit e2e6d1b116
1 changed files with 12 additions and 3 deletions

View File

@ -74,18 +74,21 @@ TEST(Expression, Leaves) {
/* ************************************************************************* */ /* ************************************************************************* */
// Unary(Leaf) // Unary(Leaf)
namespace unary { namespace unary {
Point2 f0(const Point3& p, OptionalJacobian<2,3> H) { Point2 f1(const Point3& p, OptionalJacobian<2,3> H) {
return Point2(); return Point2();
} }
double f2(const Point3& p, OptionalJacobian<1, 3> H) { double f2(const Point3& p, OptionalJacobian<1, 3> H) {
return 0.0; return 0.0;
} }
Vector f3(const Point3& p, OptionalJacobian<Eigen::Dynamic,3> H) {
return p.vector();
}
Expression<Point3> p(1); Expression<Point3> p(1);
set<Key> expected = list_of(1); set<Key> expected = list_of(1);
} }
TEST(Expression, Unary0) { TEST(Expression, Unary1) {
using namespace unary; using namespace unary;
Expression<Point2> e(f0, p); Expression<Point2> e(f1, p);
EXPECT(expected == e.keys()); EXPECT(expected == e.keys());
} }
TEST(Expression, Unary2) { TEST(Expression, Unary2) {
@ -94,6 +97,12 @@ TEST(Expression, Unary2) {
EXPECT(expected == e.keys()); EXPECT(expected == e.keys());
} }
/* ************************************************************************* */ /* ************************************************************************* */
// Unary(Leaf), dynamic
TEST(Expression, Unary3) {
using namespace unary;
// Expression<Vector> e(f3, p);
}
/* ************************************************************************* */
//Nullary Method //Nullary Method
TEST(Expression, NullaryMethod) { TEST(Expression, NullaryMethod) {