From f258bfe0443e192a6bfc341229dc641f249e139d Mon Sep 17 00:00:00 2001 From: Jing Dong Date: Fri, 17 Oct 2014 14:44:37 -0400 Subject: [PATCH] add DerivedValue test for Cal3Unified --- gtsam/geometry/tests/testCal3Unified.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gtsam/geometry/tests/testCal3Unified.cpp b/gtsam/geometry/tests/testCal3Unified.cpp index b260415f1..de9a8b739 100644 --- a/gtsam/geometry/tests/testCal3Unified.cpp +++ b/gtsam/geometry/tests/testCal3Unified.cpp @@ -19,6 +19,9 @@ #include #include +#include +#include + using namespace gtsam; GTSAM_CONCEPT_TESTABLE_INST(Cal3Unified) @@ -97,6 +100,19 @@ TEST( Cal3Unified, retract) CHECK(assert_equal(d,K.localCoordinates(actual),1e-9)); } +/* ************************************************************************* */ +TEST( Cal3Unified, DerivedValue) +{ + Values values; + Cal3Unified cal(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + Key key = 1; + values.insert(key, cal); + + Cal3Unified calafter = values.at(key); + + CHECK(assert_equal(cal,calafter,1e-9)); +} + /* ************************************************************************* */ int main() { TestResult tr; return TestRegistry::runAllTests(tr); } /* ************************************************************************* */