MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ExpectFailure

Function ExpectFailure

tensorflow/core/framework/node_def_util_test.cc:58–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58void 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
77TEST(NodeDefUtilTest, In) {
78 const OpDef op = ToOpDef(OpDefBuilder("In").Input("i: T").Attr("T: type"));

Callers 6

TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TESTFunction · 0.85
TEST_FFunction · 0.85

Calls 6

ValidateNodeDefFunction · 0.85
SummarizeNodeDefFunction · 0.85
SummarizeOpDefFunction · 0.85
StrContainsFunction · 0.50
okMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected