13 #include <gtest/gtest.h> 14 #include "../../include/ecl/geometry/cartesian_point.hpp" 20 using ecl::linear_algebra::Vector3d;
28 TEST(CartesianPointTests,construct) {
30 EXPECT_EQ(0.1,point.x());
31 EXPECT_EQ(0.2,point.y());
32 EXPECT_EQ(0.3,point.z());
33 Vector3d v; v << 0.1, 0.2, 0.3;
35 EXPECT_EQ(0.1,p2.x());
36 EXPECT_EQ(0.2,p2.y());
37 EXPECT_EQ(0.3,p2.z());
40 TEST(CartesianPointTests,assignment) {
42 point << 1.0, 2.0, 3.0;
43 EXPECT_EQ(1.0,point.x());
44 EXPECT_EQ(2.0,point.y());
45 EXPECT_EQ(3.0,point.z());
49 EXPECT_EQ(1.0,point.x());
50 EXPECT_EQ(2.0,point.y());
51 EXPECT_EQ(3.0,point.z());
52 Vector3d v; v << 1.0, 2.0, 3.0;
54 EXPECT_EQ(1.0,point.x());
55 EXPECT_EQ(2.0,point.y());
56 EXPECT_EQ(3.0,point.z());
59 TEST(CartesianPointTests,vectorHandle) {
61 point << 1.0, 2.0, 3.0;
62 const Vector3d& v = point.positionVector();
68 TEST(CartesianPointTests,constAccessors) {
70 point << 1.0, 2.0, 3.0;
71 const int cx = point.x();
72 const int cy = point.y();
73 const int cz = point.z();
83 int main(
int argc,
char **argv) {
85 testing::InitGoogleTest(&argc,argv);
86 return RUN_ALL_TESTS();
CartesianPoint< double, 3 > CartesianPoint3d
Eigen style convenience handle for x, y, z triples in double format.
TEST(CartesianPointTests, construct)
int main(int argc, char **argv)
Generic container storing a cartesian point of dimension N.