| 24 | namespace { |
| 25 | |
| 26 | TEST(SessionTest, InvalidTargetReturnsNull) { |
| 27 | SessionOptions options; |
| 28 | options.target = "invalid target"; |
| 29 | |
| 30 | EXPECT_EQ(nullptr, tensorflow::NewSession(options)); |
| 31 | |
| 32 | Session* session; |
| 33 | Status s = tensorflow::NewSession(options, &session); |
| 34 | EXPECT_EQ(s.code(), error::NOT_FOUND); |
| 35 | EXPECT_TRUE(absl::StrContains( |
| 36 | s.error_message(), |
| 37 | "No session factory registered for the given session options")); |
| 38 | } |
| 39 | |
| 40 | // Register a fake session factory to test error handling paths in |
| 41 | // NewSession(). |
nothing calls this directly
no test coverage detected