From 85fe43949dc6683cf57072177d97344f7c3957b2 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Wed, 3 Mar 2010 02:50:49 +0000 Subject: [PATCH] arithmetic tests --- cpp/testPoint3.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cpp/testPoint3.cpp b/cpp/testPoint3.cpp index dc4f51434..d9f0e708a 100644 --- a/cpp/testPoint3.cpp +++ b/cpp/testPoint3.cpp @@ -11,9 +11,15 @@ using namespace gtsam; Point3 P(0.2,0.7,-2); /* ************************************************************************* */ -TEST( Point3, scalar_multiplication) +TEST( Point3, arithmetic) { CHECK(P*3==3*P); + CHECK(assert_equal( Point3(-1,-5,-6), -Point3(1,5,6) )); + CHECK(assert_equal( Point3(2,5,6), Point3(1,4,5)+Point3(1,1,1))); + CHECK(assert_equal( Point3(0,3,4), Point3(1,4,5)-Point3(1,1,1))); + CHECK(assert_equal( Point3(2,8,6), Point3(1,4,3)*2)); + CHECK(assert_equal( Point3(2,2,6), 2*Point3(1,1,3))); + CHECK(assert_equal( Point3(1,2,3), Point3(2,4,6)/2)); } /* ************************************************************************* */