aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/framework/variant_op_copy_test.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-04-02 10:50:09 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-04-02 10:52:29 -0700
commit82bb63b958f5e39fb57ad45147b7d2c662c9b06c (patch)
tree334b52ad4b5c75c92ae86307a6d5076e9f645741 /tensorflow/core/framework/variant_op_copy_test.cc
parent3edab0abb1213f88507692042a320abc695ff674 (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: 191314576
Diffstat (limited to 'tensorflow/core/framework/variant_op_copy_test.cc')
-rw-r--r--tensorflow/core/framework/variant_op_copy_test.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/tensorflow/core/framework/variant_op_copy_test.cc b/tensorflow/core/framework/variant_op_copy_test.cc
index 85e014f804..60fa7bd559 100644
--- a/tensorflow/core/framework/variant_op_copy_test.cc
+++ b/tensorflow/core/framework/variant_op_copy_test.cc
@@ -34,6 +34,7 @@ limitations under the License.
#include "tensorflow/core/framework/variant_tensor_data.h"
#include "tensorflow/core/graph/node_builder.h"
#include "tensorflow/core/lib/core/status_test_util.h"
+#include "tensorflow/core/lib/strings/str_util.h"
#include "tensorflow/core/platform/test.h"
#include "tensorflow/core/util/port.h"
@@ -259,8 +260,8 @@ TEST(VariantOpCopyTest, CreateConstOnGPUFailsGracefully) {
ClientSession session(root);
std::vector<Tensor> outputs;
Status s = session.Run({create_const}, &outputs);
- EXPECT_TRUE(StringPiece(s.error_message())
- .contains("GPU copy from non-DMA string tensor"))
+ EXPECT_TRUE(str_util::StrContains(s.error_message(),
+ "GPU copy from non-DMA string tensor"))
<< s.ToString();
}
@@ -365,8 +366,9 @@ TEST(VariantOpCopyTest, CreateCopyCPUToGPUStringFailsSafely) {
std::vector<Tensor> outputs;
Status err = session.Run({create_op, identity}, &outputs);
EXPECT_EQ(err.code(), errors::Code::INVALID_ARGUMENT);
- EXPECT_TRUE(StringPiece(err.error_message())
- .contains("During Variant Host->Device Copy: non-DMA-copy "
+ EXPECT_TRUE(
+ str_util::StrContains(err.error_message(),
+ "During Variant Host->Device Copy: non-DMA-copy "
"attempted of tensor type: string"))
<< err.error_message();
}