Replaced calls to deprecated tensorflow::StringPiece methods with their
authorA. Unique TensorFlower <gardener@tensorflow.org>
Mon, 9 Apr 2018 17:46:59 +0000 (10:46 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Mon, 9 Apr 2018 17:49:11 +0000 (10:49 -0700)
tensorflow::str_util equivalents.

This will allow the deprecated methods to be removed.

PiperOrigin-RevId: 192150230

tensorflow/core/common_runtime/direct_session_test.cc

index fbe7b7d..8ddc995 100644 (file)
@@ -254,7 +254,7 @@ TEST_F(DirectSessionMinusAXTest, TestTensorConnection) {
     Status s = session->MakeCallable(callable_options, &handle);
     EXPECT_TRUE(errors::IsInvalidArgument(s));
     EXPECT_TRUE(
-        StringPiece(s.error_message()).contains("would create a cycle"));
+        str_util::StrContains(s.error_message(), "would create a cycle"));
   }
 
   {
@@ -268,7 +268,7 @@ TEST_F(DirectSessionMinusAXTest, TestTensorConnection) {
     Session::CallableHandle handle;
     Status s = session->MakeCallable(callable_options, &handle);
     EXPECT_TRUE(errors::IsInvalidArgument(s));
-    EXPECT_TRUE(StringPiece(s.error_message()).contains("unknown node"));
+    EXPECT_TRUE(str_util::StrContains(s.error_message(), "unknown node"));
   }
 
   {
@@ -283,7 +283,7 @@ TEST_F(DirectSessionMinusAXTest, TestTensorConnection) {
     Session::CallableHandle handle;
     Status s = session->MakeCallable(callable_options, &handle);
     EXPECT_TRUE(errors::IsInvalidArgument(s));
-    EXPECT_TRUE(StringPiece(s.error_message()).contains("unknown edge"));
+    EXPECT_TRUE(str_util::StrContains(s.error_message(), "unknown edge"));
   }
 
   {
@@ -298,7 +298,7 @@ TEST_F(DirectSessionMinusAXTest, TestTensorConnection) {
     Status s = session->MakeCallable(callable_options, &handle);
     EXPECT_TRUE(errors::IsNotFound(s));
     EXPECT_TRUE(
-        StringPiece(s.error_message()).contains("unable to find feed output"));
+        str_util::StrContains(s.error_message(), "unable to find feed output"));
   }
 
   {
@@ -315,7 +315,7 @@ TEST_F(DirectSessionMinusAXTest, TestTensorConnection) {
     Session::CallableHandle handle;
     Status s = session->MakeCallable(callable_options, &handle);
     EXPECT_TRUE(errors::IsInvalidArgument(s));
-    EXPECT_TRUE(StringPiece(s.error_message()).contains("fed more than once"));
+    EXPECT_TRUE(str_util::StrContains(s.error_message(), "fed more than once"));
   }
 
   {
@@ -330,7 +330,7 @@ TEST_F(DirectSessionMinusAXTest, TestTensorConnection) {
     Session::CallableHandle handle;
     Status s = session->MakeCallable(callable_options, &handle);
     EXPECT_TRUE(errors::IsInvalidArgument(s));
-    EXPECT_TRUE(StringPiece(s.error_message()).contains("fed more than once"));
+    EXPECT_TRUE(str_util::StrContains(s.error_message(), "fed more than once"));
   }
 }