Skip to content

Commit

Permalink
Print matrices when checks fail
Browse files Browse the repository at this point in the history
  • Loading branch information
furgalep committed Jan 8, 2015
1 parent 56b0f57 commit 91ab5e2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/eigen-checks/internal/gtest-equal.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ ::testing::AssertionResult MatricesNear(
failure_reason << "The matrices have a different number of cols: "
<< name_lhs << " has " << lhs.cols() << " cols while " << name_rhs
<< " cols " << rhs.cols() << " cols." << std::endl;
failure_reason << name_lhs << ":\n" << lhs << std::endl;
failure_reason << name_rhs << ":\n" << rhs << std::endl;
return failure_reason;
}

Expand Down Expand Up @@ -69,6 +71,9 @@ ::testing::AssertionResult MatricesNear(
}
}
}
failure_reason << name_lhs << ":\n" << lhs << std::endl;
failure_reason << name_rhs << ":\n" << rhs << std::endl;
failure_reason << "Difference:\n" << (lhs - rhs) << std::endl;
return failure_reason;
}
}
Expand Down

0 comments on commit 91ab5e2

Please sign in to comment.