| 56 | } |
| 57 | |
| 58 | void ExpectFailure(const NodeDef& bad, const OpDef& op_def, |
| 59 | const string& message) { |
| 60 | Status status = ValidateNodeDef(bad, op_def); |
| 61 | |
| 62 | EXPECT_FALSE(status.ok()) << "NodeDef: " << SummarizeNodeDef(bad) |
| 63 | << "; OpDef: " << SummarizeOpDef(op_def); |
| 64 | if (status.ok()) return; |
| 65 | |
| 66 | EXPECT_TRUE(errors::IsInvalidArgument(status)) |
| 67 | << status << "; NodeDef: " << SummarizeNodeDef(bad) |
| 68 | << "; OpDef: " << SummarizeOpDef(op_def); |
| 69 | |
| 70 | LOG(INFO) << "Message: " << status.error_message(); |
| 71 | EXPECT_TRUE(absl::StrContains(status.ToString(), message)) |
| 72 | << "NodeDef: " << SummarizeNodeDef(bad) |
| 73 | << "; OpDef: " << SummarizeOpDef(op_def) << "\nActual error: " << status |
| 74 | << "\nDoes not contain: " << message; |
| 75 | } |
| 76 | |
| 77 | TEST(NodeDefUtilTest, In) { |
| 78 | const OpDef op = ToOpDef(OpDefBuilder("In").Input("i: T").Attr("T: type")); |
no test coverage detected