diff options
author | Håvard Pettersen <havardpe@oath.com> | 2017-09-28 15:26:40 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2017-09-29 10:16:46 +0000 |
commit | abefb37a660e395342a1460e233a0933d2e10dc9 (patch) | |
tree | 8f7bbea42745102db5269a89e6efdbce117fc603 /eval | |
parent | 88a6576a3cf7b15b2bf9a4cd3bcc861e3a4f38c0 (diff) |
avoid requiring that json parsing consumes all input
(the input could end with \n if human readable)
Diffstat (limited to 'eval')
-rw-r--r-- | eval/src/tests/tensor/tensor_slime_serialization/tensor_slime_serialization_test.cpp | 4 | ||||
-rw-r--r-- | eval/src/vespa/eval/eval/test/tensor_conformance.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/eval/src/tests/tensor/tensor_slime_serialization/tensor_slime_serialization_test.cpp b/eval/src/tests/tensor/tensor_slime_serialization/tensor_slime_serialization_test.cpp index 916b6ad4462..3dc203b27e2 100644 --- a/eval/src/tests/tensor/tensor_slime_serialization/tensor_slime_serialization_test.cpp +++ b/eval/src/tests/tensor/tensor_slime_serialization/tensor_slime_serialization_test.cpp @@ -35,7 +35,7 @@ struct Fixture vespalib::Memory memory_exp(exp); vespalib::Slime expSlime; size_t used = vespalib::slime::JsonFormat::decode(memory_exp, expSlime); - EXPECT_EQUAL(used, memory_exp.size); + EXPECT_TRUE(used); EXPECT_EQUAL(expSlime, *slime); } }; @@ -135,7 +135,7 @@ struct DenseFixture vespalib::Memory memory_exp(exp); vespalib::Slime expSlime; size_t used = vespalib::slime::JsonFormat::decode(memory_exp, expSlime); - EXPECT_EQUAL(used, memory_exp.size); + EXPECT_TRUE(used); EXPECT_EQUAL(expSlime, *slime); } }; diff --git a/eval/src/vespa/eval/eval/test/tensor_conformance.cpp b/eval/src/vespa/eval/eval/test/tensor_conformance.cpp index 4e321083252..244749c98ab 100644 --- a/eval/src/vespa/eval/eval/test/tensor_conformance.cpp +++ b/eval/src/vespa/eval/eval/test/tensor_conformance.cpp @@ -1267,7 +1267,7 @@ struct TestContext { MappedFileInput file(path); Slime slime; EXPECT_TRUE(file.valid()); - EXPECT_EQUAL(JsonFormat::decode(file, slime), file.get().size); + EXPECT_TRUE(JsonFormat::decode(file, slime)); int64_t num_tests = slime.get()["num_tests"].asLong(); Cursor &tests = slime.get()["tests"]; EXPECT_GREATER(num_tests, 0u); |