2013-07-03 06:26:19 +08:00
|
|
|
#include <QSignalSpy>
|
2013-07-02 12:45:04 +08:00
|
|
|
#include <QTest>
|
|
|
|
|
|
2013-07-03 06:26:19 +08:00
|
|
|
#include <qredis/request.h>
|
2013-07-02 12:45:04 +08:00
|
|
|
#include "testclient.h"
|
|
|
|
|
|
|
|
|
|
void TestClient::initTestCase()
|
|
|
|
|
{
|
|
|
|
|
client.connectToHost("localhost");
|
|
|
|
|
QVERIFY(client.waitForConnected());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TestClient::cleanupTestCase()
|
|
|
|
|
{
|
|
|
|
|
client.disconnectFromHost();
|
2013-07-02 12:51:48 +08:00
|
|
|
|
|
|
|
|
if(client.isConnected())
|
|
|
|
|
QVERIFY(client.waitForDisconnected());
|
2013-07-02 12:45:04 +08:00
|
|
|
}
|
2013-07-03 06:26:19 +08:00
|
|
|
|
|
|
|
|
void TestClient::testPing()
|
|
|
|
|
{
|
|
|
|
|
QRedis::Request * request = client.sendCommand("PING");
|
|
|
|
|
QVERIFY(request->waitForReply());
|
|
|
|
|
}
|