Main MRPT website > C++ reference for MRPT 1.5.6
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 
const GLdouble * v
Definition: glew.h:1296
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
Definition: eigen_frwds.h:35
TEST(CVectorDouble, resize)



Page generated by Doxygen 1.8.6 for MRPT 1.5.6 Git: 4c65e84 Tue Apr 24 08:18:17 2018 +0200 at mar abr 24 08:26:17 CEST 2018