Main MRPT website > C++ reference for MRPT 1.9.9
container_ops_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 
10 #include <mrpt/utils/types_math.h>
11 #include <gtest/gtest.h>
12 
13 using namespace mrpt;
14 using namespace mrpt::utils;
15 using namespace mrpt::math;
16 using namespace std;
17 
19 {
20  {
22  EXPECT_TRUE(v.size() == 0);
23  }
24 
25  for (int i = 0; i < 10; i++)
26  {
28  EXPECT_TRUE(v.size() == i);
29  }
30 
31  for (int i = 0; i < 10; i++)
32  {
34  v.resize(i);
35  EXPECT_TRUE(v.size() == i);
36  }
37 
38  for (int i = 10; i >= 0; i--)
39  {
41  v.resize(i);
42  EXPECT_TRUE(v.size() == i);
43  }
44 
45  {
47  for (int i = 0; i < 10; i++)
48  {
49  v.push_back(double(i));
50  EXPECT_TRUE(v.size() == (i + 1));
51  }
52  for (int i = 0; i < 10; i++)
53  {
54  EXPECT_TRUE(v[i] == i);
55  }
56  }
57 }
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
Definition: eigen_frwds.h:42
STL namespace.
This base provides a set of functions for maths stuff.
Definition: CArrayNumeric.h:19
TEST(CVectorDouble, resize)
const GLdouble * v
Definition: glext.h:3678
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.



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