10 #include <gtest/gtest.h> 23 ptr1.
reset(
new int());
27 EXPECT_TRUE(*ptr1 == 123);
31 EXPECT_TRUE(*ptr1 == *ptr2);
34 EXPECT_FALSE(*ptr1 == *ptr2);
39 EXPECT_TRUE(*ptr1 == *ptr2);
42 EXPECT_FALSE(*ptr1 == *ptr2);
53 std::vector<str2d_ptr>
v;
54 for (
int i = 0; i < 10; i++)
56 v.push_back(str2d_ptr(
new str2d_ptr::value_type));
62 EXPECT_TRUE(
v3->second == 3);
65 EXPECT_TRUE(
v3->second == 4);
66 EXPECT_TRUE(
v[3]->second == 3);
78 EXPECT_NEAR(ptr1->
x(), 123.0, 1e-9);
82 EXPECT_TRUE(*ptr1 == *ptr2);
85 EXPECT_FALSE(*ptr1 == *ptr2);
90 EXPECT_TRUE(*ptr1 == *ptr2);
93 EXPECT_FALSE(*ptr1 == *ptr2);
104 std::vector<str2d_ptr>
v;
105 for (
int i = 0; i < 10; i++)
107 v.push_back(str2d_ptr(
new str2d_ptr::value_type));
112 EXPECT_NEAR(
v3->x(), 3.0, 1e-9);
115 EXPECT_NEAR(
v3->x(), 4.0, 1e-9);
116 EXPECT_NEAR(
v[3]->
x(), 3.0, 1e-9);
internal::generic_copier_ptr< T, internal::CopyCloner< T > > poly_ptr
Smart pointer for polymorphic classes with a clone() method.
GLfloat GLfloat GLfloat GLfloat v3
double x() const
Common members of all points & poses classes.
TEST(copy_ptr, SimpleOps)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void x_incr(const double v)
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
internal::generic_copier_ptr< T, internal::CopyStatic< T > > copy_ptr
Smart pointer for non-polymorphic classes.
void reset(T *ptr=nullptr)