aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/lite/toco/import_tensorflow_test.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-06-12 19:18:30 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-06-12 19:21:07 -0700
commit87861251a5773315c7c2e36f85366c82cf64ad28 (patch)
treecd220ca6382802039caaa34fc0c9382723eaf0d9 /tensorflow/contrib/lite/toco/import_tensorflow_test.cc
parenta7dbbab3868437b1c4f6297dc7d6294c227a277a (diff)
Leverage the standard error space by using tensorflow::Status
PiperOrigin-RevId: 200322035
Diffstat (limited to 'tensorflow/contrib/lite/toco/import_tensorflow_test.cc')
-rw-r--r--tensorflow/contrib/lite/toco/import_tensorflow_test.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/tensorflow/contrib/lite/toco/import_tensorflow_test.cc b/tensorflow/contrib/lite/toco/import_tensorflow_test.cc
index 835676662b..d18c329a43 100644
--- a/tensorflow/contrib/lite/toco/import_tensorflow_test.cc
+++ b/tensorflow/contrib/lite/toco/import_tensorflow_test.cc
@@ -21,10 +21,10 @@ limitations under the License.
#include "tensorflow/core/framework/node_def.pb.h"
#include "tensorflow/core/framework/node_def_builder.h"
#include "tensorflow/core/framework/tensor_shape.pb.h"
+#include "tensorflow/core/lib/core/status.h"
namespace toco {
-using port::Status;
using tensorflow::AttrValue;
using tensorflow::DT_BOOL;
using tensorflow::DT_FLOAT;
@@ -33,6 +33,7 @@ using tensorflow::DT_INT64;
using tensorflow::DT_QUINT8;
using tensorflow::DT_STRING;
using tensorflow::NodeDef;
+using tensorflow::Status;
namespace internal {
Status ImportTensorFlowNode(const NodeDef&, const TensorFlowImportFlags&,
@@ -117,9 +118,10 @@ TEST_P(ShapeImportTest, ShapeElementIsNegative) {
NodeDef node;
BuildConstNode({1, -2, 10}, GetParam(), 0, &node);
auto status = ImportNode(node);
- EXPECT_EQ(status.error_message(),
- "Tensor shape should not include negative values (while processing "
- "node 'Node1')");
+ EXPECT_EQ(
+ status.error_message(),
+ "Tensor shape should not include negative values\n\t (while processing "
+ "node 'Node1')");
}
INSTANTIATE_TEST_CASE_P(ShapeElementIsNegative, ShapeImportTest,
::testing::ValuesIn(TestTypes()));
@@ -129,7 +131,7 @@ TEST_P(ShapeImportTest, ShapeElementTooLarge) {
BuildConstNode({3000000000}, GetParam(), 0, &node);
auto status = ImportNode(node);
EXPECT_EQ(status.error_message(),
- "Shape element overflows (while processing node 'Node1')");
+ "Shape element overflows\n\t (while processing node 'Node1')");
}
INSTANTIATE_TEST_CASE_P(ShapeElementTooLarge, ShapeImportTest,
::testing::ValuesIn(TestTypes()));
@@ -139,7 +141,7 @@ TEST_P(ShapeImportTest, ShapeTooLarge) {
BuildConstNode({1000000, 2000000, 2000000, 2000000}, GetParam(), 0, &node);
auto status = ImportNode(node);
EXPECT_EQ(status.error_message(),
- "Tensor shape is too large (while processing node 'Node1')");
+ "Tensor shape is too large\n\t (while processing node 'Node1')");
}
INSTANTIATE_TEST_CASE_P(ShapeTooLarge, ShapeImportTest,
::testing::ValuesIn(TestTypes()));
@@ -148,11 +150,11 @@ TEST_P(ShapeImportTest, ValidShapeButZeroElements) {
NodeDef node;
BuildConstNode({1, 2, 2, 2}, GetParam(), 0, &node);
auto status = ImportNode(node);
- EXPECT_THAT(
- status.error_message(),
- ::testing::MatchesRegex(
- "Neither input_content .0. nor .*_val .0. have the right "
- "dimensions .8. for this .* tensor .while processing node 'Node1'."));
+ EXPECT_THAT(status.error_message(),
+ ::testing::MatchesRegex(
+ "Neither input_content .0. nor .*_val .0. have the right "
+ "dimensions .8. for this .* tensor\n\t .while processing "
+ "node 'Node1'."));
}
INSTANTIATE_TEST_CASE_P(ValidShapeButZeroElements, ShapeImportTest,
::testing::ValuesIn(TestTypes()));