| 52 | a_(GraphDefBuilder::kFailImmediately) {} |
| 53 | |
| 54 | bool Match() { |
| 55 | GraphDef expected; |
| 56 | TF_EXPECT_OK(e_.ToGraphDef(&expected)); |
| 57 | GraphDef actual; |
| 58 | TF_EXPECT_OK(a_.ToGraphDef(&actual)); |
| 59 | bool match = EqualGraphDef(actual, expected, &diff_); |
| 60 | if (match) { |
| 61 | EXPECT_EQ(GraphDefHash(expected), GraphDefHash(actual)); |
| 62 | } else { |
| 63 | // While, strictly speaking, this does not have to be the case, |
| 64 | // we want to check that our hash is more than "return 0;". |
| 65 | // If, in the extremely unlikely case, some different graphs |
| 66 | // legitimately produce equal hash values in this test, we can always |
| 67 | // tweak them a little to produce different hash values. |
| 68 | EXPECT_NE(GraphDefHash(expected), GraphDefHash(actual)); |
| 69 | } |
| 70 | return match; |
| 71 | } |
| 72 | |
| 73 | GraphDefBuilder e_; |
| 74 | GraphDefBuilder a_; |
nothing calls this directly
no test coverage detected