Skip to content

Conversation

taketwo
Copy link
Member

@taketwo taketwo commented Feb 10, 2014

This pull request adds a family of macros that mimic the style of native google test macros for floats, but act on PCL points:

  • EXPECT_XYZ_EQ(expected, actual)
  • ASSERT_RGB_EQ(expected, actual)
  • EXPECT_NORMAL_NEAR(expected, actual, abs_error)
  • ...

These macros are meant to replace checks like:

EXPECT_FLOAT_EQ(p1.normal_x, p2.normal_x);
EXPECT_FLOAT_EQ(p1.normal_y, p2.normal_y);
EXPECT_FLOAT_EQ(p1.normal_z, p2.normal_z);

or

EXPECT_EQ_VECTOR(p1.getNormalVector3fMap (), p2.getNormalVector3fMap ());

with a single less convoluted statement:

EXPECT_NORMAL_EQ(p1, p2);

When such an assertion fails it provides output similar to that of google test macros:

Value of: (p2).getNormalVector3fMap ()
  Actual: 1.1000000238418579 2 3
Expected: (p1).getNormalVector3fMap ()
Which is: 1 2 3

jspricke added a commit that referenced this pull request Feb 11, 2014
Add test macros for equality/nearness checks
@jspricke jspricke merged commit 7a09f6b into PointCloudLibrary:master Feb 11, 2014
@taketwo taketwo deleted the add-pcl-test-macros branch February 11, 2014 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants