Main MRPT website > C++ reference for MRPT 1.5.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 
11 #include <mrpt/utils/types_math.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 
19 
20 
22 {
23  {
25  EXPECT_TRUE(v.size()==0);
26  }
27 
28  for (int i=0;i<10;i++)
29  {
31  EXPECT_TRUE(v.size()==i);
32  }
33 
34  for (int i=0;i<10;i++)
35  {
37  v.resize(i);
38  EXPECT_TRUE(v.size()==i);
39  }
40 
41  for (int i=10;i>=0;i--)
42  {
44  v.resize(i);
45  EXPECT_TRUE(v.size()==i);
46  }
47 
48  {
50  for (int i=0;i<10;i++)
51  {
52  v.push_back(double(i));
53  EXPECT_TRUE(v.size()==(i+1));
54  }
55  for (int i=0;i<10;i++)
56  {
57  EXPECT_TRUE(v[i]==i);
58  }
59  }
60 }
61 
62 
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition: zip.h:16
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
Definition: eigen_frwds.h:35
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:3603
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020