aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/debugger/shared/qqmldebugclient.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@digia.com>2013-10-08 11:02:24 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-16 08:34:32 +0200
commit29beac9aa1daf9a044dc62e567283779e68b3724 (patch)
tree423dc2373ebb41b16bd0336a50477286609f080f /tests/auto/qml/debugger/shared/qqmldebugclient.cpp
parent8c66618892334b4ef0b5ecced048f96d051352bd (diff)
Improve output of test case
Change-Id: Ib36583120ca42835534f0f8494637aeb9618f317 Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
Diffstat (limited to 'tests/auto/qml/debugger/shared/qqmldebugclient.cpp')
-rw-r--r--tests/auto/qml/debugger/shared/qqmldebugclient.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qml/debugger/shared/qqmldebugclient.cpp b/tests/auto/qml/debugger/shared/qqmldebugclient.cpp
index be3042311b..95674ce6d7 100644
--- a/tests/auto/qml/debugger/shared/qqmldebugclient.cpp
+++ b/tests/auto/qml/debugger/shared/qqmldebugclient.cpp
@@ -325,6 +325,23 @@ bool QQmlDebugConnection::waitForConnected(int msecs)
return d->gotHello;
}
+QString QQmlDebugConnection::stateString() const
+{
+ QString state;
+
+ if (isConnected())
+ state = "Connected";
+ else
+ state = "Not connected";
+
+ if (d->gotHello)
+ state += ", got hello";
+ else
+ state += ", did not get hello!";
+
+ return state;
+}
+
QAbstractSocket::SocketState QQmlDebugConnection::state() const
{
QAbstractSocket *socket = qobject_cast<QAbstractSocket*>(d->device);
@@ -425,6 +442,15 @@ QQmlDebugClient::State QQmlDebugClient::state() const
return Unavailable;
}
+QString QQmlDebugClient::stateString() const
+{
+ switch (state()) {
+ case NotConnected: return QLatin1String("Not connected");
+ case Unavailable: return QLatin1String("Unavailable");
+ case Enabled: return QLatin1String("Enabled");
+ }
+}
+
void QQmlDebugClient::sendMessage(const QByteArray &message)
{
if (state() != Enabled)