diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-04-02 11:03:18 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-04-02 11:05:26 -0700 |
commit | 4118b7c8432ca770191ca22fc01fd435e4e4571e (patch) | |
tree | 62194ab9b119d548d3d8d71d91ef0be0072c3e3c /tensorflow/core/common_runtime/function_test.cc | |
parent | 5617c9b4be759b62f3cbd29b0a58c41a43ac47a0 (diff) |
Replaced calls to deprecated tensorflow::StringPiece methods with their
tensorflow::str_util equivalents.
This will allow the deprecated methods to be removed.
PiperOrigin-RevId: 191316903
Diffstat (limited to 'tensorflow/core/common_runtime/function_test.cc')
-rw-r--r-- | tensorflow/core/common_runtime/function_test.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tensorflow/core/common_runtime/function_test.cc b/tensorflow/core/common_runtime/function_test.cc index d17ef4d459..61b2f0e60f 100644 --- a/tensorflow/core/common_runtime/function_test.cc +++ b/tensorflow/core/common_runtime/function_test.cc @@ -39,6 +39,7 @@ limitations under the License. #include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/lib/core/threadpool.h" +#include "tensorflow/core/lib/strings/str_util.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/public/session_options.h" #include "tensorflow/core/public/version.h" @@ -53,8 +54,8 @@ Status GetOpSig(const string& op, const OpDef** sig) { return OpRegistry::Global()->LookUpOpDef(op, sig); } -void HasError(const Status& s, const string& substr) { - EXPECT_TRUE(StringPiece(s.ToString()).contains(substr)) +void HasError(const Status& s, StringPiece substr) { + EXPECT_TRUE(str_util::StrContains(s.ToString(), substr)) << s << ", expected substring " << substr; } @@ -240,7 +241,7 @@ class FunctionLibraryRuntimeTest : public ::testing::Test { Status status2 = Run(flr, handle, opts, args, std::move(rets)); EXPECT_TRUE(errors::IsInvalidArgument(status2)); EXPECT_TRUE( - StringPiece(status2.error_message()).contains("remote execution.")); + str_util::StrContains(status2.error_message(), "remote execution.")); return status; } @@ -310,7 +311,7 @@ class FunctionLibraryRuntimeTest : public ::testing::Test { Status status2 = Run(flr, handle, opts, args, std::move(rets)); EXPECT_TRUE(errors::IsInvalidArgument(status2)); EXPECT_TRUE( - StringPiece(status2.error_message()).contains("remote execution.")); + str_util::StrContains(status2.error_message(), "remote execution.")); return status; } |