Skip to content

Commit

Permalink
adapted interface
Browse files Browse the repository at this point in the history
  • Loading branch information
simonlynen committed Mar 30, 2015
1 parent 783a807 commit a1b6f49
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions include/eigen-checks/internal/gtest-equal.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ constexpr double kDefaultPrecision = 1e-10;

template<typename LeftMat, typename RightMat>
::testing::AssertionResult MatricesEqual(const LeftMat& A,
const std::string& name_lhs,
const RightMat& B,
double threshold) {
const std::string& name_rhs,
double threshold,
const std::string& name_threshold) {
if (A.rows() != B.rows() || A.cols() != B.cols()) {
return ::testing::AssertionFailure()
<< "Matrix size mismatch: "
<< A.rows() << "x" << A.cols() << " != "
<< B.rows() << "x" << B.cols();
<< A.rows() << "x" << A.cols() << " (" << name_lhs << ") != "
<< B.rows() << "x" << B.cols() << " (" << name_rhs << ")";
}

bool success = true;
Expand All @@ -54,7 +57,8 @@ ::testing::AssertionResult MatricesEqual(const LeftMat& A,
success = false;
message +=
"\n Mismatch at [" + std::to_string(i) + "," + std::to_string(j) +
"] : " + std::to_string(Aij) + " != " + std::to_string(Bij);
"] : " + std::to_string(Aij) + " != " + std::to_string(Bij) +
" (" + name_threshold + " = " + std::to_string(threshold) + ")";
}
}
}
Expand Down

0 comments on commit a1b6f49

Please sign in to comment.