diff --git a/tests/testclient.cpp b/tests/testclient.cpp index 50d26ed..036942e 100644 --- a/tests/testclient.cpp +++ b/tests/testclient.cpp @@ -6,6 +6,8 @@ void TestClient::initTestCase() { + qRegisterMetaType("ReplyType"); + client.connectToHost("localhost"); QVERIFY(client.waitForConnected()); } @@ -21,5 +23,9 @@ void TestClient::cleanupTestCase() void TestClient::testPing() { QRedis::Request * request = client.sendCommand("PING"); + QSignalSpy spy(request, SIGNAL(reply(ReplyType,QVariant))); + QVERIFY(request->waitForReply()); + QCOMPARE(spy.count(), 1); + QCOMPARE(spy[0][1].toString(), QString("PONG")); }