Skip to content

Commit

Permalink
add macro EXPECT_EIGEN_NOT_NEAR
Browse files Browse the repository at this point in the history
  • Loading branch information
artivis committed Feb 20, 2020
1 parent f31148b commit ca2da43
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/eigen_gtest.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,21 @@ inline ::testing::AssertionResult isEigenMatrixNear(const Eigen::MatrixBase<_Der
#define EXPECT_EIGEN_NEAR(...) \
__EXPECT_EIGEN_NEAR_CHOOSER(__VA_ARGS__)(__VA_ARGS__)


#define EXPECT_EIGEN_NOT_NEAR_DEFAULT_TOL(A,B) \
EXPECT_FALSE(manif::isEigenMatrixNear(A, B, #A, #B))

#define EXPECT_EIGEN_NOT_NEAR_TOL(A,B,tol) \
EXPECT_FALSE(manif::isEigenMatrixNear(A, B, #A, #B, tol))

#define __EXPECT_EIGEN_NOT_NEAR_CHOOSER(...) \
__GET_4TH_ARG(__VA_ARGS__, EXPECT_EIGEN_NOT_NEAR_TOL, \
EXPECT_EIGEN_NOT_NEAR_DEFAULT_TOL, )

#define EXPECT_EIGEN_NOT_NEAR(...) \
__EXPECT_EIGEN_NOT_NEAR_CHOOSER(__VA_ARGS__)(__VA_ARGS__)


#define ASSERT_EIGEN_NEAR_DEFAULT_TOL(A,B) \
ASSERT_TRUE(manif::isEigenMatrixNear(A, B, #A, #B))

Expand Down

0 comments on commit ca2da43

Please sign in to comment.