From 4b91a18532634eb42e948307ddfc605097eb8940 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Fri, 29 May 2015 13:43:30 -0700 Subject: [PATCH] Remove linefeed from JSON to string conversion --- src/ripple/json/impl/json_writer.cpp | 1 - src/ripple/json/tests/Output.test.cpp | 4 ---- src/ripple/protocol/tests/STObject.test.cpp | 2 +- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/ripple/json/impl/json_writer.cpp b/src/ripple/json/impl/json_writer.cpp index 9cf57f1baa..ee5d96ef05 100644 --- a/src/ripple/json/impl/json_writer.cpp +++ b/src/ripple/json/impl/json_writer.cpp @@ -190,7 +190,6 @@ FastWriter::write ( const Value& root ) { document_ = ""; writeValue ( root ); - document_ += "\n"; return std::move (document_); } diff --git a/src/ripple/json/tests/Output.test.cpp b/src/ripple/json/tests/Output.test.cpp index 7f31f30a4b..69ad9b2348 100644 --- a/src/ripple/json/tests/Output.test.cpp +++ b/src/ripple/json/tests/Output.test.cpp @@ -36,10 +36,6 @@ struct Output_test : ripple::RPC::TestOutputSuite // Compare with the original version. auto expected = Json::FastWriter().write (value); - expected.resize (expected.size() - 1); - // For some reason, the FastWriter puts a carriage return on the end of - // every piece of Json it outputs. - expectResult (expected); expectResult (valueDesc); expectResult (jsonAsString (value)); diff --git a/src/ripple/protocol/tests/STObject.test.cpp b/src/ripple/protocol/tests/STObject.test.cpp index 5110a09edb..505764ada0 100644 --- a/src/ripple/protocol/tests/STObject.test.cpp +++ b/src/ripple/protocol/tests/STObject.test.cpp @@ -91,7 +91,7 @@ public: { testcase ("parse json array"); std::string const json ( - "{\"Template\":[{\"ModifiedNode\":{\"Sequence\":1}}]}\n"); + "{\"Template\":[{\"ModifiedNode\":{\"Sequence\":1}}]}"); Json::Value jsonObject; bool parsedOK (parseJSONString(json, jsonObject));