summaryrefslogtreecommitdiff
path: root/tests/manual/ssh/errorhandling/main.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2015-06-29 10:56:15 +0200
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2015-06-29 08:59:09 +0000
commit28e163de974d5bb2cec11cd98fa223def2170433 (patch)
tree1d95fa3e8dbb37144164c320e2c01a7cc2d802be /tests/manual/ssh/errorhandling/main.cpp
parent1ef9137c0d9594272d291112b3bb375711949165 (diff)
downloadqt-creator-28e163de974d5bb2cec11cd98fa223def2170433.tar.gz
SSH: Fix exit code of tests.
The test apps now return != 0 in case of an error. Change-Id: I2380bc4b8e0c85e68d79f90ccc39ad9419851b04 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'tests/manual/ssh/errorhandling/main.cpp')
-rw-r--r--tests/manual/ssh/errorhandling/main.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/manual/ssh/errorhandling/main.cpp b/tests/manual/ssh/errorhandling/main.cpp
index 983617bcdc..f5fa4088b5 100644
--- a/tests/manual/ssh/errorhandling/main.cpp
+++ b/tests/manual/ssh/errorhandling/main.cpp
@@ -38,6 +38,8 @@
#include <QPair>
#include <QTimer>
+#include <cstdlib>
+
using namespace QSsh;
class Test : public QObject {
@@ -117,27 +119,27 @@ private slots:
void handleConnected()
{
qDebug("Error: Received unexpected connected() signal.");
- qApp->quit();
+ qApp->exit(EXIT_FAILURE);
}
void handleDisconnected()
{
qDebug("Error: Received unexpected disconnected() signal.");
- qApp->quit();
+ qApp->exit(EXIT_FAILURE);
}
void handleDataAvailable(const QString &msg)
{
qDebug("Error: Received unexpected dataAvailable() signal. "
"Message was: '%s'.", qPrintable(msg));
- qApp->quit();
+ qApp->exit(EXIT_FAILURE);
}
void handleError(QSsh::SshError error)
{
if (m_testSet.isEmpty()) {
qDebug("Error: Received error %d, but no test was running.", error);
- qApp->quit();
+ qApp->exit(EXIT_FAILURE);
}
const TestItem testItem = m_testSet.takeFirst();
@@ -151,7 +153,7 @@ private slots:
}
} else {
qDebug("Received unexpected error %d.", error);
- qApp->quit();
+ qApp->exit(EXIT_FAILURE);
}
}
@@ -159,7 +161,7 @@ private slots:
{
if (m_testSet.isEmpty()) {
qDebug("Error: timeout, but no test was running.");
- qApp->quit();
+ qApp->exit(EXIT_FAILURE);
}
const TestItem testItem = m_testSet.takeFirst();
qDebug("Error: The following test timed out: %s", testItem.description);