13 #include <gtest/gtest.h>
14 #include "../../include/ecl/geometry/homogeneous_point.hpp"
20 using ecl::linear_algebra::Vector3d;
21 using ecl::linear_algebra::Vector4d;
22 using ecl::linear_algebra::Vector4f;
31 TEST(HomogeneousPointTests,construct) {
33 EXPECT_EQ(0.1,point.x());
34 EXPECT_EQ(0.2,point.y());
35 EXPECT_EQ(0.3,point.z());
38 EXPECT_EQ(0.1,p2.x());
39 EXPECT_EQ(0.2,p2.y());
40 EXPECT_EQ(0.3,p2.z());
43 EXPECT_EQ(1.0,p3.x());
44 EXPECT_EQ(2.0,p3.y());
45 EXPECT_EQ(3.0,p3.z());
48 TEST(HomogeneousPointTests,assignment) {
50 point << 1.0, 2.0, 3.0, 1.0;
51 EXPECT_EQ(1.0,point.x());
52 EXPECT_EQ(2.0,point.y());
53 EXPECT_EQ(3.0,point.z());
57 EXPECT_EQ(1.0,point.x());
58 EXPECT_EQ(2.0,point.y());
59 EXPECT_EQ(3.0,point.z());
62 EXPECT_EQ(1.0,point.x());
63 EXPECT_EQ(2.0,point.y());
64 EXPECT_EQ(3.0,point.z());
67 TEST(HomogeneousPointTests,vectorHandle) {
69 point << 1.0, 2.0, 3.0, 1.0;
70 const Vector4d& v = point.positionVector();
76 TEST(HomogeneousPointTests,constAccessors) {
78 point << 1.0, 2.0, 3.0, 1.0;
79 const int cx = point.x();
80 const int cy = point.y();
81 const int cz = point.z();
91 int main(
int argc,
char **argv) {
92 testing::InitGoogleTest(&argc,argv);
93 return RUN_ALL_TESTS();