aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/tests/common/hostreporter/util.cpp
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@oath.com>2017-09-28 15:26:40 +0000
committerHåvard Pettersen <havardpe@oath.com>2017-09-29 10:16:46 +0000
commitabefb37a660e395342a1460e233a0933d2e10dc9 (patch)
tree8f7bbea42745102db5269a89e6efdbce117fc603 /storage/src/tests/common/hostreporter/util.cpp
parent88a6576a3cf7b15b2bf9a4cd3bcc861e3a4f38c0 (diff)
avoid requiring that json parsing consumes all input
(the input could end with \n if human readable)
Diffstat (limited to 'storage/src/tests/common/hostreporter/util.cpp')
-rw-r--r--storage/src/tests/common/hostreporter/util.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/storage/src/tests/common/hostreporter/util.cpp b/storage/src/tests/common/hostreporter/util.cpp
index a9578e8d8cf..ad4931cb15f 100644
--- a/storage/src/tests/common/hostreporter/util.cpp
+++ b/storage/src/tests/common/hostreporter/util.cpp
@@ -24,10 +24,10 @@ reporterToSlime(HostReporter &hostReporter, vespalib::Slime &slime) {
hostReporter.report(stream);
stream << End();
std::string jsonData = json.str();
- size_t parsedSize = JsonFormat::decode(Memory(jsonData), slime);
+ size_t parsed = JsonFormat::decode(Memory(jsonData), slime);
- if (jsonData.size() != parsedSize) {
- CPPUNIT_FAIL("Sizes of jsonData mismatched, probably not json:\n" + jsonData);
+ if (!parsed) {
+ CPPUNIT_FAIL("jsonData is not json:\n" + jsonData);
}
}
}