From c4691496228efcd0b87762530ad09140d3e2ead9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Fischer?= Date: Thu, 10 Oct 2019 14:22:19 +0200 Subject: [PATCH] increase timeout on QSignalSpy --- test/unitTests/UnitTest.cpp | 18 ++++++++++++------ test/unitTests/unittest.h | 3 ++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/test/unitTests/UnitTest.cpp b/test/unitTests/UnitTest.cpp index 4a4acc1..cc95a13 100644 --- a/test/unitTests/UnitTest.cpp +++ b/test/unitTests/UnitTest.cpp @@ -6,7 +6,7 @@ void UnitTest::loginSuccessfully() QJsonDocument config = testAccess->getConfig(); QSignalSpy spy(testAccess, SIGNAL(successLogin())); testAccess->login(host, email, password); - spy.wait(); + spy.wait(10000); QVERIFY(spy.isValid()); QCOMPARE(spy.count(), 1); QString json = testAccess->getResponse(); @@ -22,7 +22,7 @@ void UnitTest::getSubjects() RequestManager* testAccess = new RequestManager(); QSignalSpy spy(testAccess, SIGNAL(responseReady())); response = testAccess->getSubjects(); - spy.wait(); + spy.wait(10000); QVERIFY(spy.isValid()); QCOMPARE(spy.count(), 1); QString json = response->reply->readAll(); @@ -41,7 +41,7 @@ void UnitTest::getTokens() QSignalSpy spy(testAccess, SIGNAL(responseReady())); response = testAccess->getTokens(); QCOMPARE(spy.count(), 0); - spy.wait(); + spy.wait(10000); QVERIFY(spy.isValid()); QCOMPARE(spy.count(), 1); QString json = response->reply->readAll(); @@ -59,7 +59,7 @@ void UnitTest::getTokenSubject() QSignalSpy spy(testAccess, SIGNAL(responseReady())); response = testAccess->getTokenSubject(); QCOMPARE(spy.count(), 0); - spy.wait(); + spy.wait(10000); QVERIFY(spy.isValid()); QCOMPARE(spy.count(), 1); QString json = response->reply->readAll(); @@ -85,7 +85,7 @@ void UnitTest::subjectJSONParser() RequestManager* testAccess = new RequestManager(); QSignalSpy spy(testAccess, SIGNAL(responseReady())); response = testAccess->getSubjects(); - spy.wait(); + spy.wait(10000); QString json = response->reply->readAll(); QJsonDocument doc = QJsonDocument::fromJson(json.toUtf8()); QJsonArray arr = doc.object()["items"].toArray(); @@ -101,7 +101,7 @@ void UnitTest::tokenJSONParser() RequestManager* testAccess = new RequestManager(); QSignalSpy spy(testAccess, SIGNAL(responseReady())); response = testAccess->getTokens(); - spy.wait(); + spy.wait(10000); QString json = response->reply->readAll(); QJsonDocument doc = QJsonDocument::fromJson(json.toUtf8()); QJsonArray arr = doc.object()["items"].toArray(); @@ -169,5 +169,11 @@ void UnitTest::saveDataToDB() } +void UnitTest::getUuid() +{ + qDebug() << QUuid::createUuid().toString(QUuid::WithoutBraces); + QCOMPARE(1,1); +} + QTEST_MAIN(UnitTest) diff --git a/test/unitTests/unittest.h b/test/unitTests/unittest.h index 73a9313..7cc34f5 100644 --- a/test/unitTests/unittest.h +++ b/test/unitTests/unittest.h @@ -20,12 +20,13 @@ private slots: void loginSuccessfully(); // /AaaManager/authSession void getSubjects(); // /SubjectManager/getSubjects void getTokens(); // /TokenManager/getTokens - void getTokenSubject(); // /OpenManager/getTokenSubject + void getTokenSubject(); // /OpenManager/getTokenSubject void subjectJSONParser(); void tokenJSONParser(); void connectToDB(); //void debugConnection(); void saveDataToDB(); + void getUuid(); private: //QString host = "http://localhost:8080"; //colnod server (ssh -L 8080:192.168.254.11:8443 penta-master)