diff options
author | Gunhan Gulsoy <gunan@google.com> | 2018-02-01 23:47:33 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-02-02 10:31:05 -0800 |
commit | 4e1863b76676afb863131f09ce8f9ac44f04e816 (patch) | |
tree | 265fc5ea59e1045c18b6ecb10094635494a049e2 /tensorflow/contrib/lite/tools/verifier_test.cc | |
parent | e46e0459c2e5135db3ff72918a463ce9f48d204e (diff) |
Fix some tf-lite tests
PiperOrigin-RevId: 184247187
Diffstat (limited to 'tensorflow/contrib/lite/tools/verifier_test.cc')
-rw-r--r-- | tensorflow/contrib/lite/tools/verifier_test.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tensorflow/contrib/lite/tools/verifier_test.cc b/tensorflow/contrib/lite/tools/verifier_test.cc index 244d4f0396..87f6854e9e 100644 --- a/tensorflow/contrib/lite/tools/verifier_test.cc +++ b/tensorflow/contrib/lite/tools/verifier_test.cc @@ -12,7 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/contrib/lite/tools/verifier.h" +#include <string> +#include <vector> + #include "flatbuffers/flatbuffers.h" #include "flatbuffers/util.h" #include <gtest/gtest.h> @@ -20,7 +22,9 @@ limitations under the License. #include "tensorflow/contrib/lite/error_reporter.h" #include "tensorflow/contrib/lite/schema/schema_generated.h" #include "tensorflow/contrib/lite/testing/util.h" +#include "tensorflow/contrib/lite/tools/verifier.h" #include "tensorflow/contrib/lite/version.h" +#include "tensorflow/core/framework/numeric_types.h" namespace tflite { @@ -111,7 +115,7 @@ TEST(VerifyModel, TestSimpleModel) { } TEST(VerifyModel, TestCorruptedData) { - string model = "123"; + std::string model = "123"; ASSERT_FALSE(Verify(model.data(), model.size(), /*error_reporter=*/nullptr)); } @@ -131,8 +135,8 @@ TEST(VerifyModel, TestRandomModificationIsNotAllowed) { /*subgraphs=*/0, /*description=*/0, /*buffers=*/0); ::tflite::FinishModelBuffer(builder, model); - string model_content(reinterpret_cast<char*>(builder.GetBufferPointer()), - builder.GetSize()); + std::string model_content(reinterpret_cast<char*>(builder.GetBufferPointer()), + builder.GetSize()); for (int i = 0; i < model_content.size(); i++) { model_content[i] = (model_content[i] + 137) % 255; EXPECT_FALSE(Verify(model_content.data(), model_content.size(), |