62 template <
typename V1,
typename V2>
67 std::size_t length =
v1.
size ();
68 for (std::size_t i = 0; i < length; ++i)
72 template <
typename V1,
typename V2,
typename Scalar>
77 std::size_t length =
v1.
size ();
78 for (std::size_t i = 0; i < length; ++i)
85 template <
typename Po
int1T,
typename Po
int2T>
92 return ::testing::AssertionSuccess ();
93 return ::testing::AssertionFailure ()
94 <<
"Value of: " <<
expr2 <<
".getVector3fMap ()" << std::endl
95 <<
" Actual: " << p2.getVector3fMap ().transpose () << std::endl
96 <<
"Expected: " <<
expr1 <<
".getVector3fMap ()" << std::endl
97 <<
"Which is: " << p1.getVector3fMap ().transpose ();
100 template <
typename Po
int1T,
typename Po
int2T>
111 return ::testing::AssertionSuccess ();
112 return ::testing::AssertionFailure ()
113 <<
"Some of the element-wise differences exceed " <<
abs_error_expr
114 <<
" (which evaluates to " <<
abs_error <<
")" << std::endl
115 <<
"Difference: " <<
diff.transpose () << std::endl
116 <<
" Value of: " <<
expr2 <<
".getVector3fMap ()" << std::endl
117 <<
" Actual: " << p2.getVector3fMap ().transpose () << std::endl
118 <<
" Expected: " <<
expr1 <<
".getVector3fMap ()" << std::endl
119 <<
" Which is: " << p1.getVector3fMap ().transpose ();
122 template <
typename Po
int1T,
typename Po
int2T>
129 return ::testing::AssertionSuccess ();
130 return ::testing::AssertionFailure ()
131 <<
"Value of: " <<
expr2 <<
".getNormalVector3fMap ()" << std::endl
132 <<
" Actual: " << p2.getNormalVector3fMap ().transpose () << std::endl
133 <<
"Expected: " <<
expr1 <<
".getNormalVector3fMap ()" << std::endl
134 <<
"Which is: " << p1.getNormalVector3fMap ().transpose ();
137 template <
typename Po
int1T,
typename Po
int2T>
148 return ::testing::AssertionSuccess ();
149 return ::testing::AssertionFailure ()
150 <<
"Some of the element-wise differences exceed " <<
abs_error_expr
151 <<
" (which evaluates to " <<
abs_error <<
")" << std::endl
152 <<
"Difference: " <<
diff.transpose () << std::endl
153 <<
" Value of: " <<
expr2 <<
".getNormalVector3fMap ()" << std::endl
154 <<
" Actual: " << p2.getNormalVector3fMap ().transpose () << std::endl
155 <<
" Expected: " <<
expr1 <<
".getNormalVector3fMap ()" << std::endl
156 <<
" Which is: " << p1.getNormalVector3fMap ().transpose ();
159 template <
typename Po
int1T,
typename Po
int2T>
166 return ::testing::AssertionSuccess ();
167 return ::testing::AssertionFailure ()
168 <<
"Value of: " <<
expr2 <<
".getRGBVector3i ()" << std::endl
169 <<
" Actual: " << p2.getRGBVector3i ().transpose () << std::endl
170 <<
"Expected: " <<
expr1 <<
".getRGBVector3i ()" << std::endl
171 <<
"Which is: " << p1.getRGBVector3i ().transpose ();
174 template <
typename Po
int1T,
typename Po
int2T>
181 return ::testing::AssertionSuccess ();
182 return ::testing::AssertionFailure ()
183 <<
"Value of: " <<
expr2 <<
".getRGBAVector4i ()" << std::endl
184 <<
" Actual: " << p2.getRGBAVector4i ().transpose () << std::endl
185 <<
"Expected: " <<
expr1 <<
".getRGBAVector4i ()" << std::endl
186 <<
"Which is: " << p1.getRGBAVector4i ().transpose ();
189 template <
typename Po
intCloud1T,
typename Po
intCloud2T>
195 if (!(p1.header == p2.header))
196 return ::testing::AssertionFailure () <<
"Headers are different";
197 if (p1.width != p2.width)
198 return ::testing::AssertionFailure ()
199 <<
"Value of: " <<
expr2 <<
".width" << std::endl
200 <<
" Actual: " << p2.width << std::endl
201 <<
"Expected: " <<
expr1 <<
".width" << std::endl
202 <<
"Which is: " << p1.width << std::endl;
203 if (p1.height != p2.height)
204 return ::testing::AssertionFailure ()
205 <<
"Value of: " <<
expr2 <<
".height" << std::endl
206 <<
" Actual: " << p2.height << std::endl
207 <<
"Expected: " <<
expr1 <<
".height" << std::endl
208 <<
"Which is: " << p1.height << std::endl;
209 if (p1.is_dense != p2.is_dense)
210 return ::testing::AssertionFailure ()
211 <<
"Value of: " <<
expr2 <<
".is_dense" << std::endl
212 <<
" Actual: " << p2.is_dense << std::endl
213 <<
"Expected: " <<
expr1 <<
".is_dense" << std::endl
214 <<
"Which is: " << p1.is_dense << std::endl;
215 if (p1.sensor_origin_ != p2.sensor_origin_)
216 return ::testing::AssertionFailure () <<
"Sensor origins are different";
217 if (p1.sensor_orientation_.coeffs () != p2.sensor_orientation_.coeffs ())
218 return ::testing::AssertionFailure () <<
"Sensor orientations are different";
219 return ::testing::AssertionSuccess ();
226 if(std::find(v.cbegin(), v.cend(), item)==v.cend()) {
229 std::copy(v.cbegin(), v.cend()-1, std::ostream_iterator<V>(
vec_rep,
", "));
236 return ::testing::AssertionFailure ()
237 <<
"Actual : " <<
expr2 << std::endl
238 <<
"contains : " <<
vec_rep.str() << std::endl
239 <<
"Target set : " <<
expr1 << std::endl
243 return ::testing::AssertionSuccess ();
249 if(std::find(v.cbegin(), v.cend(), item)!=v.cend()) {
251 std::copy(v.cbegin(), v.cend()-1, std::ostream_iterator<V>(
vec_rep,
", "));
258 return ::testing::AssertionFailure ()
259 <<
"Actual : " <<
expr2 << std::endl
260 <<
"contains : " <<
vec_rep.str() << std::endl
261 <<
"Forbidden set: " <<
expr1 << std::endl
265 return ::testing::AssertionSuccess ();
276#define EXPECT_XYZ_EQ(expected, actual) \
277 EXPECT_PRED_FORMAT2(::pcl::test::internal::XYZEQ, \
278 (expected), (actual))
282#define ASSERT_XYZ_EQ(expected, actual) \
283 ASSERT_PRED_FORMAT2(::pcl::test::internal::XYZEQ, \
284 (expected), (actual))
288#define EXPECT_XYZ_NEAR(expected, actual, abs_error) \
289 EXPECT_PRED_FORMAT3(::pcl::test::internal::XYZNear, \
290 (expected), (actual), abs_error)
294#define ASSERT_XYZ_NEAR(expected, actual, abs_error) \
295 ASSERT_PRED_FORMAT3(::pcl::test::internal::XYZNear, \
296 (expected), (actual), abs_error)
300#define EXPECT_NORMAL_EQ(expected, actual) \
301 EXPECT_PRED_FORMAT2(::pcl::test::internal::NormalEQ, \
302 (expected), (actual))
306#define ASSERT_NORMAL_EQ(expected, actual) \
307 ASSERT_PRED_FORMAT2(::pcl::test::internal::NormalEQ, \
308 (expected), (actual))
313#define EXPECT_NORMAL_NEAR(expected, actual, abs_error) \
314 EXPECT_PRED_FORMAT3(::pcl::test::internal::NormalNear, \
315 (expected), (actual), abs_error)
320#define ASSERT_NORMAL_NEAR(expected, actual, abs_error) \
321 ASSERT_PRED_FORMAT3(::pcl::test::internal::NormalNear, \
322 (expected), (actual), abs_error)
326#define EXPECT_RGB_EQ(expected, actual) \
327 EXPECT_PRED_FORMAT2(::pcl::test::internal::RGBEQ, \
328 (expected), (actual))
332#define ASSERT_RGB_EQ(expected, actual) \
333 ASSERT_PRED_FORMAT2(::pcl::test::internal::RGBEQ, \
334 (expected), (actual))
338#define EXPECT_RGBA_EQ(expected, actual) \
339 EXPECT_PRED_FORMAT2(::pcl::test::internal::RGBAEQ, \
340 (expected), (actual))
344#define ASSERT_RGBA_EQ(expected, actual) \
345 ASSERT_PRED_FORMAT2(::pcl::test::internal::RGBAEQ, \
346 (expected), (actual))
351#define ASSERT_METADATA_EQ(expected, actual) \
352 ASSERT_PRED_FORMAT2(::pcl::test::internal::MetaDataEQ, \
358#define EXPECT_METADATA_EQ(expected, actual) \
359 EXPECT_PRED_FORMAT2(::pcl::test::internal::MetaDataEQ, \
365#define EXPECT_VECTOR_CONTAINS_ALL(expected, actual) \
366 EXPECT_PRED_FORMAT2(::pcl::test::internal::VectorContainsAll, \
372#define EXPECT_VECTOR_DOES_NOT_CONTAIN(expected, actual) \
373 EXPECT_PRED_FORMAT2(::pcl::test::internal::VectorDoesNotContain, \
380#define ASSERT_VECTOR_CONTAINS_ALL(expected, actual) \
381 ASSERT_PRED_FORMAT2(::pcl::test::internal::VectorContainsAll, \
387#define ASSERT_VECTOR_DOES_NOT_CONTAIN(expected, actual) \
388 ASSERT_PRED_FORMAT2(::pcl::test::internal::VectorDoesNotContain, \
Iterator class for point clouds with or without given indices.
std::size_t size() const
Size of the range the iterator is going through.
::testing::AssertionResult RGBAEQ(const char *expr1, const char *expr2, const Point1T &p1, const Point2T &p2)
::testing::AssertionResult MetaDataEQ(const char *expr1, const char *expr2, const PointCloud1T &p1, const PointCloud2T &p2)
::testing::AssertionResult VectorContainsAll(const char *expr1, const char *expr2, const std::vector< V > &elements, const std::vector< V > &v)
::testing::AssertionResult RGBEQ(const char *expr1, const char *expr2, const Point1T &p1, const Point2T &p2)
::testing::AssertionResult XYZNear(const char *expr1, const char *expr2, const char *abs_error_expr, const Point1T &p1, const Point2T &p2, double abs_error)
::testing::AssertionResult XYZEQ(const char *expr1, const char *expr2, const Point1T &p1, const Point2T &p2)
::testing::AssertionResult VectorDoesNotContain(const char *expr1, const char *expr2, const std::vector< V > &elements, const std::vector< V > &v)
::testing::AssertionResult NormalNear(const char *expr1, const char *expr2, const char *abs_error_expr, const Point1T &p1, const Point2T &p2, double abs_error)
::testing::AssertionResult NormalEQ(const char *expr1, const char *expr2, const Point1T &p1, const Point2T &p2)
void EXPECT_NEAR_VECTORS(const V1 &v1, const V2 &v2, const Scalar &epsilon)
void EXPECT_EQ_VECTORS(const V1 &v1, const V2 &v2)