diff options
author | Milla Pohjanheimo <milla.pohjanheimo@qt.io> | 2016-09-15 13:31:15 +0300 |
---|---|---|
committer | Milla Pohjanheimo <milla.pohjanheimo@qt.io> | 2016-09-16 05:29:25 +0000 |
commit | e843384150e7b3cad3e837d611c50f6db4d85942 (patch) | |
tree | 670125688fb3bcd780184463101611937276d56e | |
parent | 90e0033d0993db152a751f9998368521d83a0bd3 (diff) |
registerUnknownProduct() add more platforms and increase timeout
tst_QInAppStore::registerUnknownProduct sometimes fails with timeout
due to network overload. Added the timeout so that instead of failing
we wait longer, since it's better to wait than to fail.
Also added iOS and WinRT if we ever run the tests on those platforms.
Change-Id: I670d4ea72206a6645cd98940f8c48c6c87c05403
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
-rw-r--r-- | tests/auto/purchasing/qinappstore/tst_qinappstore.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/purchasing/qinappstore/tst_qinappstore.cpp b/tests/auto/purchasing/qinappstore/tst_qinappstore.cpp index d2efd0d..127d6d5 100644 --- a/tests/auto/purchasing/qinappstore/tst_qinappstore.cpp +++ b/tests/auto/purchasing/qinappstore/tst_qinappstore.cpp @@ -73,11 +73,14 @@ void tst_QInAppStore::registerUnknownProduct() store.registerProduct(QInAppProduct::Consumable, QStringLiteral("unknownConsumable")); store.registerProduct(QInAppProduct::Unlockable, QStringLiteral("unknownUnlockable")); -#if !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) +//The backend is implemented on iOS, macOS, WinRT and Android, for others we expect failure. +#if !defined(Q_OS_DARWIN) && !defined(Q_OS_ANDROID) && !defined(Q_OS_WINRT) QEXPECT_FAIL("", "Qt Purchasing not implemented on this platform.", Abort); #endif - QTRY_COMPARE(receiver.unknownProducts.size(), 2); + //Due to network overload or connectivity issues QTRY_COMPARE sometimes fails with timeout, + //that's why we need to increase the value, since it's better to wait than to fail. + QTRY_COMPARE_WITH_TIMEOUT(receiver.unknownProducts.size(), 2, 10000); QCOMPARE(receiver.registeredProducts.size(), 0); QCOMPARE(receiver.readyTransactions.size(), 0); |