Callback helper that dumps literals to temporary files in the event of a miscomparison.
| 49 | // Callback helper that dumps literals to temporary files in the event of a |
| 50 | // miscomparison. |
| 51 | void OnMiscompare(const LiteralSlice& expected, const LiteralSlice& actual, |
| 52 | const LiteralSlice& mismatches, |
| 53 | const ShapeIndex& /*shape_index*/) { |
| 54 | LOG(INFO) << "expected: " << ShapeUtil::HumanString(expected.shape()) << " " |
| 55 | << literal_comparison::ToStringTruncated(expected); |
| 56 | LOG(INFO) << "actual: " << ShapeUtil::HumanString(actual.shape()) << " " |
| 57 | << literal_comparison::ToStringTruncated(actual); |
| 58 | LOG(INFO) << "Dumping literals to temp files..."; |
| 59 | WriteLiteralToTempFile(expected, "expected"); |
| 60 | WriteLiteralToTempFile(actual, "actual"); |
| 61 | WriteLiteralToTempFile(mismatches, "mismatches"); |
| 62 | } |
| 63 | |
| 64 | ::testing::AssertionResult StatusToAssertion(const Status& s) { |
| 65 | if (s.ok()) { |
nothing calls this directly
no test coverage detected