MRPT  2.0.0
container_ops_unittest.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #include <gtest/gtest.h>
12 
13 using namespace mrpt;
14 using namespace mrpt::math;
15 using namespace std;
16 
18 {
19  {
21  EXPECT_TRUE(v.size() == 0);
22  }
23 
24  for (int i = 0; i < 10; i++)
25  {
27  EXPECT_TRUE(v.size() == i);
28  }
29 
30  for (int i = 0; i < 10; i++)
31  {
33  v.resize(i);
34  EXPECT_TRUE(v.size() == i);
35  }
36 
37  for (int i = 10; i >= 0; i--)
38  {
40  v.resize(i);
41  EXPECT_TRUE(v.size() == i);
42  }
43 
44  {
46  for (int i = 0; i < 10; i++)
47  {
48  v.push_back(double(i));
49  EXPECT_TRUE(v.size() == (i + 1));
50  }
51  for (int i = 0; i < 10; i++) EXPECT_NEAR(v[i], i, 1e-10);
52  }
53 }
EXPECT_TRUE(mrpt::system::fileExists(ini_fil))
size_type size() const
Get a 2-vector with [NROWS NCOLS] (as in MATLAB command size(x))
STL namespace.
void push_back(const T &val)
This base provides a set of functions for maths stuff.
TEST(CVectorDouble, resize)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void resize(std::size_t N, bool zeroNewElements=false)
EXPECT_NEAR(out.cam_params.rightCameraPose.x, 0.1194, 0.005)
images resize(NUM_IMGS)



Page generated by Doxygen 1.8.14 for MRPT 2.0.0 Git: b38439d21 Tue Mar 31 19:58:06 2020 +0200 at miƩ abr 1 00:50:30 CEST 2020