aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/tests/common/hostreporter/util.cpp
diff options
context:
space:
mode:
authorArnstein Ressem <aressem@gmail.com>2017-10-02 18:15:56 +0200
committerGitHub <noreply@github.com>2017-10-02 18:15:56 +0200
commit31a1e77a22c08fe93fa29daafdf301c69914d694 (patch)
treeba67a9f5f8e0cca7739ec702a9bdb10273daab2d /storage/src/tests/common/hostreporter/util.cpp
parent72e28a72370c6ab4756bb03c69090cc540db26a0 (diff)
Revert "Revert "Havardpe/avoid reading past json value in slime json parser""
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..e0563a431e6 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 == 0) {
+ CPPUNIT_FAIL("jsonData is not json:\n" + jsonData);
}
}
}