From 8c4332cbab6933ded049bc6ee8c406f6dd36d12f Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 5 May 2014 00:40:05 +0200 Subject: [PATCH] 2 small test additions to complete jsonrpc tests --- tests/auto/jsonrpc/testjsonrpc.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/jsonrpc/testjsonrpc.cpp b/tests/auto/jsonrpc/testjsonrpc.cpp index bd2eb376..6067810d 100644 --- a/tests/auto/jsonrpc/testjsonrpc.cpp +++ b/tests/auto/jsonrpc/testjsonrpc.cpp @@ -90,6 +90,8 @@ void TestJSONRPC::testHandshake() QJsonDocument jsonDoc = QJsonDocument::fromJson(spy.first().at(1).toByteArray()); QVariantMap handShake = jsonDoc.toVariant().toMap(); QVERIFY2(handShake.value("version").toString() == GUH_VERSION_STRING, "Handshake version doesn't match Guh version."); + + m_mockTcpServer->clientDisconnected(newClientId); } void TestJSONRPC::testBasicCall_data() @@ -105,6 +107,7 @@ void TestJSONRPC::testBasicCall_data() QTest::newRow("invalid function") << QByteArray("{\"id\":42, \"method\":\"JSONRPC.Foobar\"}") << true << false; QTest::newRow("invalid namespace") << QByteArray("{\"id\":42, \"method\":\"FOO.Introspect\"}") << true << false; QTest::newRow("missing dot") << QByteArray("{\"id\":42, \"method\":\"JSONRPCIntrospect\"}") << true << false; + QTest::newRow("invalid params") << QByteArray("{\"id\":42, \"method\":\"JSONRPC.Introspect\", \"params\":{\"törööö\":\"chooo-chooo\"}}") << true << false; } void TestJSONRPC::testBasicCall()