Main MRPT website > C++ reference for MRPT 1.9.9
lightweight_geom_data_unittest.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
11 #include <mrpt/utils/CTraitsTest.h>
12 #include <gtest/gtest.h>
13 
14 using namespace mrpt;
15 using namespace mrpt::utils;
16 using namespace mrpt::math;
17 using namespace std;
18 
25 
26 TEST(LightGeomData, PragmaPack)
27 {
28  {
29  TPoint2D p;
30  EXPECT_TRUE(&p.x == &(p[0]));
31  EXPECT_TRUE(&p.y == &(p[1]));
32  }
33  {
34  TPoint3D p;
35  EXPECT_TRUE(&p.x == &(p[0]));
36  EXPECT_TRUE(&p.y == &(p[1]));
37  EXPECT_TRUE(&p.z == &(p[2]));
38  }
39  {
40  TPose2D p;
41  EXPECT_TRUE(&p.x == &(p[0]));
42  EXPECT_TRUE(&p.y == &(p[1]));
43  EXPECT_TRUE(&p.phi == &(p[2]));
44  }
45  {
46  TPose3D p;
47  EXPECT_TRUE(&p.x == &(p[0]));
48  EXPECT_TRUE(&p.y == &(p[1]));
49  EXPECT_TRUE(&p.z == &(p[2]));
50  EXPECT_TRUE(&p.yaw == &(p[3]));
51  EXPECT_TRUE(&p.pitch == &(p[4]));
52  EXPECT_TRUE(&p.roll == &(p[5]));
53  }
54  {
55  TSegment2D s;
56  EXPECT_TRUE(&s.point1 == &(s[0]));
57  EXPECT_TRUE(&s.point2 == &(s[1]));
58  }
59 }
60 
61 TEST(LightGeomData, ExpectedMemorySizes)
62 {
63  EXPECT_EQ(sizeof(TPoint2D), 2 * sizeof(double));
64  EXPECT_EQ(sizeof(TPoint3D), 3 * sizeof(double));
65  EXPECT_EQ(sizeof(TPoint3Df), 3 * sizeof(float));
66  EXPECT_EQ(sizeof(TPose2D), 3 * sizeof(double));
67  EXPECT_EQ(sizeof(TPose3D), 6 * sizeof(double));
68  EXPECT_EQ(sizeof(TPose3DQuat), 7 * sizeof(double));
69 }
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
STL namespace.
GLdouble s
Definition: glext.h:3676
This base provides a set of functions for maths stuff.
Definition: CArrayNumeric.h:19
2D segment, consisting of two points.
Lightweight 3D point (float version).
TEST(LightGeomData, PragmaPack)
Lightweight 3D pose (three spatial coordinates, plus a quaternion ).
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
Lightweight 2D pose.
Lightweight 3D point.
Lightweight 2D point.
GLfloat GLfloat p
Definition: glext.h:6305



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019