| 176 | } |
| 177 | |
| 178 | void ExpectFailure(const string& ascii_node_def, DeviceType device_type, |
| 179 | error::Code code) { |
| 180 | NodeDef node_def; |
| 181 | protobuf::TextFormat::ParseFromString(ascii_node_def, &node_def); |
| 182 | Status status; |
| 183 | std::unique_ptr<OpKernel> op( |
| 184 | CreateOpKernel(std::move(device_type), &device_, cpu_allocator(), |
| 185 | node_def, TF_GRAPH_DEF_VERSION, &status)); |
| 186 | EXPECT_TRUE(op == nullptr); |
| 187 | EXPECT_FALSE(status.ok()); |
| 188 | if (!status.ok()) { |
| 189 | LOG(INFO) << "Status message: " << status.error_message(); |
| 190 | EXPECT_EQ(code, status.code()); |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | private: |
| 195 | DeviceBase device_; |
nothing calls this directly
no test coverage detected