diff options
author | Aurindam Jana <aurindam.jana@nokia.com> | 2011-12-15 17:52:22 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-16 11:42:57 +0100 |
commit | cac6c2d474ae1bf42de3e8138cda71c9e5391437 (patch) | |
tree | f82ccad3abd269d0dfeaee7671a180e743b10672 /tests | |
parent | 152a35b027258188bb57db2bafebe5b46d88eb43 (diff) |
DeclarativeDebug: Add version info to service plugins
Send the version info of each plugin alongwith the
plugin names to client.
Change-Id: I223689b32cdc5b0c48a4f508330033352b427937
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Diffstat (limited to 'tests')
5 files changed, 16 insertions, 26 deletions
diff --git a/tests/auto/declarative/debugger/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp b/tests/auto/declarative/debugger/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp index 43f92dfb64..7306b89a2c 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp +++ b/tests/auto/declarative/debugger/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp @@ -109,14 +109,16 @@ void tst_QDeclarativeDebugClient::status() QDeclarativeDebugConnection dummyConn; QDeclarativeDebugClient client("tst_QDeclarativeDebugClient::status()", &dummyConn); QCOMPARE(client.status(), QDeclarativeDebugClient::NotConnected); + QCOMPARE(client.serviceVersion(), -1.0f); } QDeclarativeDebugTestClient client("tst_QDeclarativeDebugClient::status()", m_conn); QCOMPARE(client.status(), QDeclarativeDebugClient::Unavailable); { - QDeclarativeDebugTestService service("tst_QDeclarativeDebugClient::status()"); + QDeclarativeDebugTestService service("tst_QDeclarativeDebugClient::status()", 2); QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled); + QCOMPARE(client.serviceVersion(), 2.0f); } QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Unavailable); diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp b/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp index f2c028219e..0f9da032e8 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp +++ b/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp @@ -174,7 +174,6 @@ private slots: void connect(); void interrupt(); void breakAfterCompile(); - void getDebuggerVersion(); void getVersion(); void getVersionWhenAttaching(); @@ -271,7 +270,6 @@ public: void connect(); void interrupt(); void breakAfterCompile(bool enabled); - void debuggerVersion(); void continueDebugging(StepAction stepAction, int stepCount = 1); void evaluate(QString expr, bool global = false, bool disableBreak = false, int frame = -1, const QVariantMap &addContext = QVariantMap()); @@ -303,7 +301,6 @@ signals: void connected(); void interruptRequested(); void breakAfterCompileRequested(); - void gotVersion(); void result(); void stopped(); @@ -342,11 +339,6 @@ void QJSDebugClient::breakAfterCompile(bool enabled) sendMessage(packMessage(BREAKAFTERCOMPILE, request)); } -void QJSDebugClient::debuggerVersion() -{ - sendMessage(packMessage(VERSION)); -} - void QJSDebugClient::continueDebugging(StepAction action, int count) { // { "seq" : <number>, @@ -959,8 +951,6 @@ void QJSDebugClient::messageReceived(const QByteArray &data) } else if (type == BREAKAFTERCOMPILE) { emit breakAfterCompileRequested(); - } else if (type == VERSION) { - emit gotVersion(); } } } @@ -1089,17 +1079,6 @@ void tst_QDeclarativeDebugJS::breakAfterCompile() QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); } -void tst_QDeclarativeDebugJS::getDebuggerVersion() -{ - QVERIFY(init()); - client->debuggerVersion(); - - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(gotVersion()))); - - QString version(client->response); - QCOMPARE(version, QLatin1String("1.1")); -} - void tst_QDeclarativeDebugJS::getVersion() { //void version() diff --git a/tests/auto/declarative/debugger/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp b/tests/auto/declarative/debugger/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp index 6754503de9..77a2514c20 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp +++ b/tests/auto/declarative/debugger/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp @@ -66,6 +66,7 @@ private slots: void initTestCase(); void name(); + void version(); void status(); void sendMessage(); void idForObject(); @@ -99,10 +100,18 @@ void tst_QDeclarativeDebugService::name() { QString name = "tst_QDeclarativeDebugService::name()"; - QDeclarativeDebugService service(name); + QDeclarativeDebugService service(name, 1); QCOMPARE(service.name(), name); } +void tst_QDeclarativeDebugService::version() +{ + QString name = "tst_QDeclarativeDebugService::name()"; + + QDeclarativeDebugService service(name, 2); + QCOMPARE(service.version(), 2.0f); +} + void tst_QDeclarativeDebugService::status() { QDeclarativeDebugTestService service("tst_QDeclarativeDebugService::status()"); diff --git a/tests/auto/declarative/debugger/shared/debugutil.cpp b/tests/auto/declarative/debugger/shared/debugutil.cpp index c259ac953c..41c97eaad8 100644 --- a/tests/auto/declarative/debugger/shared/debugutil.cpp +++ b/tests/auto/declarative/debugger/shared/debugutil.cpp @@ -58,8 +58,8 @@ bool QDeclarativeDebugTest::waitForSignal(QObject *receiver, const char *member, return timer.isActive(); } -QDeclarativeDebugTestService::QDeclarativeDebugTestService(const QString &s, QObject *parent) - : QDeclarativeDebugService(s, parent) +QDeclarativeDebugTestService::QDeclarativeDebugTestService(const QString &s, float version, QObject *parent) + : QDeclarativeDebugService(s, version, parent) { registerService(); } diff --git a/tests/auto/declarative/debugger/shared/debugutil_p.h b/tests/auto/declarative/debugger/shared/debugutil_p.h index 4d2ee160d5..e24bdbd02f 100644 --- a/tests/auto/declarative/debugger/shared/debugutil_p.h +++ b/tests/auto/declarative/debugger/shared/debugutil_p.h @@ -64,7 +64,7 @@ class QDeclarativeDebugTestService : public QDeclarativeDebugService { Q_OBJECT public: - QDeclarativeDebugTestService(const QString &s, QObject *parent = 0); + QDeclarativeDebugTestService(const QString &s, float version = 1, QObject *parent = 0); signals: void statusHasChanged(); |