forked from ethz-asl/eigen_checks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9dd597c
commit 4d61cfc
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef EIGEN_CHECKS_GLOG_H_ | ||
#define EIGEN_CHECKS_GLOG_H_ | ||
#include <glog/logging.h> | ||
#include <limits> | ||
#include <eigen-checks/internal/gtest-equal.h> | ||
#include <eigen-checks/internal/traits.h> | ||
|
||
#define CHECK_EIGEN_MATRIX_EQUAL(MatrixA, MatrixB) \ | ||
do { \ | ||
::testing::AssertionResult result = eigen_checks::internal::MatricesNear(\ | ||
MatrixA, #MatrixA, MatrixB, #MatrixB, \ | ||
static_cast<typename eigen_checks::internal::RemoveCR< \ | ||
decltype(MatrixA)>::type::Scalar>(0.0), "0.0"); \ | ||
CHECK(static_cast<bool>(result)) << result.message; \ | ||
} while(0); | ||
|
||
#define CHECK_EIGEN_MATRIX_EQUAL_DOUBLE(MatrixA, MatrixB) \ | ||
do { \ | ||
::testing::AssertionResult result = eigen_checks::internal::MatricesNear(\ | ||
MatrixA, #MatrixA, MatrixB, #MatrixB, \ | ||
static_cast<typename eigen_checks::internal::RemoveCR< \ | ||
decltype(MatrixA)>::type::Scalar>( \ | ||
eigen_checks::internal::kDefaultPrecision), \ | ||
"Floating point precision"); \ | ||
CHECK(static_cast<bool>(result)) << result.message; \ | ||
} while(0); | ||
|
||
#define CHECK_EIGEN_MATRIX_NEAR(MatrixA, MatrixB, Precision) \ | ||
do { \ | ||
::testing::AssertionResult result = eigen_checks::internal::MatricesNear(\ | ||
MatrixA, #MatrixA, MatrixB, #MatrixB, Precision, #Precision); \ | ||
CHECK(static_cast<bool>(result)) << result.message; \ | ||
} while(0); | ||
|
||
#endif // EIGEN_CHECKS_GLOG_H_ |