From f999c2bcaeb0e3b5dea6cb9a7d8fb52fb54be1e5 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 16 Mar 2011 12:51:43 +0900 Subject: [PATCH] Added test for JSON-RPC GET request without params parameter. --- test/JsonTest.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/JsonTest.cc b/test/JsonTest.cc index 3f18bd2a..eb11e9a4 100644 --- a/test/JsonTest.cc +++ b/test/JsonTest.cc @@ -472,6 +472,14 @@ void JsonTest::testDecodeGetParams() CPPUNIT_ASSERT_EQUAL(std::string("[{}]"), gparam.request); CPPUNIT_ASSERT_EQUAL(std::string("cb"), gparam.callback); } + { + std::string query = "?method=sum&id=300"; + json::JsonGetParam gparam = json::decodeGetParams(query); + CPPUNIT_ASSERT_EQUAL(std::string("{\"method\":\"sum\"," + "\"id\":\"300\"}"), + gparam.request); + CPPUNIT_ASSERT_EQUAL(std::string(), gparam.callback); + } } } // namespace aria2