diff options
author | 2018-04-04 12:08:49 -0700 | |
---|---|---|
committer | 2018-04-04 12:11:49 -0700 | |
commit | 13e103b8f0dcc89673dd0d3d589b976c05c37a09 (patch) | |
tree | 3debee5abeae72842052b360124504c5a62e9779 /tensorflow/tools/graph_transforms/transform_graph_test.cc | |
parent | bd540c8c45bf66a9c14af38a272840b47731b91a (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: 191627087
Diffstat (limited to 'tensorflow/tools/graph_transforms/transform_graph_test.cc')
-rw-r--r-- | tensorflow/tools/graph_transforms/transform_graph_test.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tensorflow/tools/graph_transforms/transform_graph_test.cc b/tensorflow/tools/graph_transforms/transform_graph_test.cc index bc2412fcbd..b276229aa4 100644 --- a/tensorflow/tools/graph_transforms/transform_graph_test.cc +++ b/tensorflow/tools/graph_transforms/transform_graph_test.cc @@ -22,6 +22,7 @@ limitations under the License. #include "tensorflow/core/framework/tensor_testutil.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/lib/io/path.h" +#include "tensorflow/core/lib/strings/str_util.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/platform/test_benchmark.h" #include "tensorflow/core/public/session.h" @@ -112,12 +113,11 @@ class TransformGraphTest : public ::testing::Test { graph_transforms::MapNamesToNodes(out_graph_def, &out_node_map); for (const NodeDef& node : out_graph_def.node()) { - const StringPiece name(node.name()); const int occurrence_count = out_node_map.count(node.name()); - if (name.ends_with("expect_removed")) { + if (str_util::EndsWith(node.name(), "expect_removed")) { EXPECT_EQ(0, occurrence_count) << "node.name()=" << node.name(); } - if (name.ends_with("expect_remains")) { + if (str_util::EndsWith(node.name(), "expect_remains")) { EXPECT_EQ(1, occurrence_count) << "node.name()=" << node.name(); } } @@ -139,7 +139,7 @@ class TransformGraphTest : public ::testing::Test { Status no_such_status = TransformGraph({}, {}, {{"test_no_such_transform", {}}}, &graph_def); EXPECT_TRUE( - StringPiece(no_such_status.ToString()).contains("not recognized")); + str_util::StrContains(no_such_status.ToString(), "not recognized")); } void TestParseTransformParameters() { |