summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
* Remove references to obsolete platformsJake Petroules2017-11-051-17/+0
| | | | | | | | | | | | | | ultrix and reliant have not seen a release since 1995. dgux not since 2001. bsdi not since 2003. irix not since 2006. osf not since 2010. dynix... unclear, but no later than 2002. symbian needs no mention. All considered obsolete, all gone. sco and unixware are effectively obsolete. Remove them until someone expresses a real need. Change-Id: Ia3d9d370016adce9213ae5ad0ef965ef8de2a3ff Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-172-11/+26
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/fortuneclient/client.cpp examples/network/fortuneserver/server.cpp src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h src/plugins/platforms/cocoa/qcocoabackingstore.h src/plugins/platforms/cocoa/qcocoaintegration.h src/plugins/platforms/cocoa/qcocoascreen.h src/plugins/platforms/ios/qiosbackingstore.h src/plugins/sqldrivers/oci/qsql_oci.cpp src/widgets/kernel/qwidgetwindow.cpp Change-Id: Ia6dd2c52d4a691b671cf9a2ffca70deccece8f10
| * QTest: make toString(QHostAddress) workThiago Macieira2017-10-141-1/+2
| | | | | | | | | | | | | | | | | | I don't know why this needs to be a template specialization instead of overload, like all the other toString overloads. With GCC 7, it was calling QTest::toString<QHostAddress>, which returns nullptr. Change-Id: I638cf58bfa7b4e5fb386fffd14ea7add0eef8f87 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * Fix spelling in qWaitFor commentTor Arne Vestbø2017-10-121-1/+1
| | | | | | | | | | Change-Id: I0ac67de3371ee36c21e124e88845aaae63a73f6e Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * Ensure result of all QTest::qWaitFor are verifiedTor Arne Vestbø2017-10-051-5/+6
| | | | | | | | | | | | | | | | | | The qWaitFor functions themselves can not trigger a test failure, as that will not result in the test function exiting early, so every single call to qWaitFor needs to be wrapped in a QVERIFY. Change-Id: Id15a1549f31d06cdbf788e1d84ea431c28636ec8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Workaround GCC 6 parsing error ("used but never defined")Thiago Macieira2017-09-271-3/+16
| | | | | | | | | | | | | | | | | | | | | | GCC 7 and other compilers compile this code just fine. GCC 6 fails, so this is clearly a compiler bug. So revert the implementation of the qWait() function back to the original, to make the problem disappear. qtestsystem.h:58:42: error: ‘bool QTest::qWaitFor(Functor, int) [with Functor = bool (*)()]’ used but never defined [-Werror] Change-Id: I0b48fc8e90304e0dacc3fffd14e8110138cc9f45 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * Fix build: move Q_REQUIRED_RESULT to the right positionThiago Macieira2017-09-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | If you're using GCC 7 or Clang 4, Q_REQUIRED_RESULT expands to [[nodiscard]] that must appear in as specific place on the line. qcompilerdetection.h:1182:29: error: attribute ignored [-Werror=attributes] qtestsystem.h:58:12: note: in expansion of macro ‘Q_REQUIRED_RESULT’ static Q_REQUIRED_RESULT bool qWaitFor(Functor predicate, int timeout = 5000) ^~~~~~~~~~~~~~~~~ Change-Id: I0b48fc8e90304e0dacc3fffd14e80ede168d5c6b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | qpa: enhance mouse event with type and button dataGatis Paeglis2017-10-101-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and deprecate QWSI APIs that accepts mouse event without mouse button/ type data. In the early days of Qt5 it was decided to centralize mouse button/type handling in QGuiApplication (because of limitation of some now unknown platform). This has proven to be problematic as mouse handling details differ across platforms (e.g on X11 we do not receive mouse release event when closing popup windows or ordinary windows that are closed from the mouse press event). Instead of hacking around platform specific behaviors in Qt Gui, we should move this task back to platform plugins (similar to how this was done in Qt4 with native APIs sending mouse details directly to QApplication). There are even cases where it simply is not possible to deduce (from QGuiApplication) which button caused the event (e.g. when more than one button is involved and some event goes missing). Besisdes, throwing away information which is already available at QPA level (for free) and trying to deduce it again at Qt Gui level seems impractical, fagile (as probably noticed by people fixing all the unexpected issues) and adds unnecessary complexity. Note: Removing the deprecated QWSI APIs from offscreen plugin depends on fixing autotests that rely on QOffscreenCursor::setPos() logic. For the convenience of testing use QT_QPA_DISABLE_ENHANCED_MOUSE to restore to the old code path where QGuiApplication does the mouse state deducing. Other platforms have similar issues. I do not have all supported platform available on my desk, so other platform maintainers will need to take care of porting those platforms to the new APIs. And mainly, I don't want to deal with all the hacks that other platforms have added to workaround this broken mouse logic. In Qt6 we need to remove deprecated code path from QGuiApplication. This patch: - Extends QWindowSystemInterfacePrivate::MouseEvent ctor with QEvent::Type and Qt::MouseButton. We use this extra data when processing mouse events in QGuiApplication. This actually is similar to KeyEvent, where we do pass the type (press or release) to QtGui. - Refactors QGuiApplicationPrivate::processMouseEvent and qtestlib to use the new APIs. Task-number: QTBUG-59277 Task-number: QTBUG-62329 Task-number: QTBUG-63467 Change-Id: If94fd46a7cccfea8264dcb1368804c73334558b8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | QTestLib: flush DeferredDelete events between every testDavid Faure2017-10-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes qtestlib behave more like real Qt applications with an event loop, where exiting the application does indeed flush deleteLaters. And since every test method is supposed to be independent from other test methods, we should even cleanup between tests. For "app less" tests, no flushing happens. Real life use cases: * A unittest for some code (e.g. KIO job) which uses a socket, runs an event loop until the socket communication is done, and ends. However slotDisconnected() does, as recommended, socket->deleteLater(). So the test finishes before the socket has a chance to actually get deleted, and memory leak tools flag a memory leak, which doesn't actually happen outside the unittest. * Deleting a QWebEngineView with deleteLater is even worse than a memleak, it leads to an assert (from a global object destructor) in QtWebEngine if the view deletion hasn't actually been processed. Change-Id: I18fc822fd26988a0fa4e75313c1947fcaa7d9e56 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-09-266-31/+67
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h src/plugins/platforms/cocoa/qcocoawindow.h src/testlib/qtestsystem.h Change-Id: I5975ffb3261c2dd82fe02ec4e57df7c0950226c5
| * testlib: Add qWaitFor to wait for predicateTor Arne Vestbø2017-09-254-28/+64
| | | | | | | | | | | | | | | | Reduces duplication of logic and allows other primitives to be built on top. Change-Id: Ia100014cfb0c09ac2f47c3a156d0c76f0fddafa8 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-201-2/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/util/qcompleter.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmdisubwindow.cpp Change-Id: If0e96981af07ce36ac68f2e69211bc2120f93973
| | * Testlib: Do not list unsupported optionChristian Stenger2017-09-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This option is listed when displaying the help of Quick tests, but was never actively supported as it had been removed before Qt5.0 was finally released. Change-Id: I4cdf8d86471ab72e289f27a07a5f04c0338bfdbd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-061-2/+4
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/qopenglwidget/main.cpp src/3rdparty/pcre2/src/pcre2_printint.c src/plugins/platforms/cocoa/qnsview.mm src/widgets/widgets/qcombobox.cpp Change-Id: I37ced9da1e8056f95851568bcc52cd5dc34f56af
| | * testlib: Print event coordinates and window size when event is outside of windowMitch Curtis2017-09-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gives the user a much clearer understanding of which part of the test caused the warning. Old warning: WARNING: tst_controls::Default::Dial::test_linearInputMode(mouse) Mouse event occurs outside of target window. New warning: WARNING: tst_controls::Default::Dial::test_linearInputMode(mouse) Mouse event at 501, 179 occurs outside of target window (450x450). Change-Id: I2943d79bab5a808e9b5b721758db216b91a07bbd Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-1910-41/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-194-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Android: clang fix implicit conversion warningBogDan Vatra2017-09-101-7/+7
|/ / | | | | | | | | | | | | | | | | | | The error message was: error: implicit conversion increases floating-point precision: 'float' to 'double' [-Werror,-Wdouble-promotion] Change-Id: I2cbf035d4e7b223d1280d53255d54b2a6c48ea37 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-311-1/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/examples.pro qmake/library/qmakebuiltins.cpp src/corelib/global/qglobal.cpp Re-apply b525ec2 to qrandom.cpp(code movement in 030782e) src/corelib/global/qnamespace.qdoc src/corelib/global/qrandom.cpp src/gui/kernel/qwindow.cpp Re-apply a3d59c7 to QWindowPrivate::setVisible() (code movement in d7a9e08) src/network/ssl/qsslkey_openssl.cpp src/plugins/platforms/android/androidjniinput.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/widgets/widgets/qmenu.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp Change-Id: If7ab427804408877a93cbe02079fca58e568bfd3
| * Make it possible to override QT_LOGGING_TO_CONSOLE in test casesJoerg Bornemann2017-08-281-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is currently impossible to get output from autotests in Visual Studio or Qt Creator when running under the debugger. Qt Creator's cdb integration cannot distinguish between the inferior's console output and cdb's console output. If the inferior's output came from OutputDebugString we'd be able to catch and display it. Pave a way to force QTestLib's logging facility use OutputDebugString. Task-number: QTCREATORBUG-16161 Change-Id: Iccd69c283626266ee4384a6163a8b72bb0e7df27 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | testlib: move strings from functions to array in benchmark metricLiang Qi2017-08-291-133/+57
| | | | | | | | | | Change-Id: Ida7ba60d26171b95ba0e9709eec5c6553efeecca Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Testlib: Format QVector2/3/4D in QCOMPAREFriedemann Kleint2017-08-271-0/+29
| | | | | | | | | | Change-Id: Ia0709e598d2fddd6c2f448633b484749146265f7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | QTestLib: Disable App Nap on macOSMorten Johan Sørvig2017-08-223-0/+41
| | | | | | | | | | | | | | | | App Nap may cause stalls or timer delays during test runs. Change-Id: I828282d12127918439a9a2a4f7d7be6cac457b42 Task-number: QTBUG-61499 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devThiago Macieira2017-08-082-13/+13
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/kernel/qwidget.cpp This merge also extends the expected output of the pairdiagnostics teamcity output (added in dev in commit c608ffc56ab37f9a9d5b9c34543126adb89e2b08) after the recent addition of the flowId attribute to the teamcity output (commit 8f036562119dd35ce51dc9230304d893b906bd37 in 5.9). Change-Id: I3868166e5efc45538544fffd14d8aba438f9173c
| * Add flowId to messages when logging in TeamCity formatBorgar Ovsthus2017-08-042-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | Added flowId='name' to each message when using TeamCity logging format. This is necessary to distinguish separate processes running in parallel. [ChangeLog][QtTest] Added flowId to messages when logging in TeamCity format. FlowId is used to distinguish logging from multiple processes running in parallel. Change-Id: I7f5046c1058ff02770404caa2c9b3a5398f97f6b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Move toString calls after their definitionTimo Aarnipuro2017-07-212-12/+18
| | | | | | | | | | | | | | | | | | | | | | Move two functions that are using toString(const QString &str) from qtestcase.h to qtest.h. This fixes compilation on INTEGRITY platform. Task-number: QTBUG-61702 Change-Id: I5a433126741c7a52621616c5b98203e7d642b330 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-07-191-3/+7
|\| | | | | | | | | | | | | | | Conflicts: src/corelib/io/qwindowspipewriter.cpp src/widgets/styles/qcommonstyle.cpp Change-Id: I0d33efdc4dc256e234abc490a18ccda72cd1d9e6
| * testlib: Allow tailing comments in blacklist filesTor Arne Vestbø2017-07-181-3/+7
| | | | | | | | | | | | | | Task-number: QTBUG-61987 Change-Id: I27219a6d06d7a81514e3f7b2ad5469676f724e04 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devGabriel de Dietrich2017-07-133-14/+16
|\| | | | | | | | | | | | | Conflicts: src/widgets/widgets/qmainwindowlayout.cpp Change-Id: I306b4f5ad11bceb336c9091241b468d455fe6bb6
| * QtTest: Add msvc2017 detection and keyword to blacklistingFriedemann Kleint2017-07-101-1/+3
| | | | | | | | | | Change-Id: I71162fc7dff0f29a24fd78e1188f8d86c2834d3c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Fix modernize-use-bool-literals issuesKevin Funk2017-07-082-13/+13
| | | | | | | | | | | | | | | | | | | | | | Reported by clang-tidy. Skipped fixes in implementation files, only changed headers. Change-Id: I5cfd266b3d4046f90baebc0c538b1b6ab03a02d2 Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Document expose event behaviorMorten Johan Sørvig2017-07-111-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | Document that "visible"-but-obscured windows may not get expose events for various audiences: QTestLib users, platform plugin authors and on the QExposeEvent itself. QWindow::exposeEvent() already has this documented and is not changed. Task-number: QTBUG-50414 Change-Id: I91042e8b1c70e48f10e692b2e80367d242a8ccbe Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-041-8/+10
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/util/util.pri tests/auto/corelib/thread/qthread/qthread.pro tests/auto/corelib/thread/qthread/tst_qthread.cpp Change-Id: I5c45ab54d46d3c75a5c6c116777ebf5bc47a871b
| * Allow using Xcode Command Line Tools to build QtJake Petroules2017-06-291-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some users don't want to download the full Xcode installation which can weigh upwards of 5 GB download and 20 GB installed. [ChangeLog][macOS / iOS] Qt can now be built using just the Xcode Command Line Tools, without needing to install the full Xcode IDE. Task-number: QTBUG-35928 Task-number: QTBUG-41908 Change-Id: I6d13c9a03ab9087b3ab56e8547f53f0cc2806c7b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | Split QTest::qExec()J-P Nurmi2017-06-222-30/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split into (internal) QTest::qInit(), qRun(), and qCleanup(), that allow qtquickcontrols2 to initialize the test framework once, repeat the tests for all built-in styles (Default, Material, Universal), and finally cleanup things: $ ./tst_qquickbutton text ********* Start testing of tst_QQuickButton ********* Config: Using QtTest library 5.10.0, Qt 5.10.0 (...) PASS : tst_QQuickButton::Default::initTestCase() PASS : tst_QQuickButton::Default::text() PASS : tst_QQuickButton::Default::cleanupTestCase() PASS : tst_QQuickButton::Material::initTestCase() PASS : tst_QQuickButton::Material::text() PASS : tst_QQuickButton::Material::cleanupTestCase() PASS : tst_QQuickButton::Universal::initTestCase() PASS : tst_QQuickButton::Universal::text() PASS : tst_QQuickButton::Universal::cleanupTestCase() Totals: 9 passed, 0 failed, 0 skipped, 0 blacklisted, 2215ms ********* Finished testing of tst_QQuickButton ********* Notice that QTest::qExec() cannot be called multiple times, because it would print the headers/footers/results separately for each round. Change-Id: Ibb24b694491d4e790db32e40837c3a5c6d9d2840 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | testlib: add key sequence functionLiang Qi2017-06-222-0/+38
| | | | | | | | | | | | | | | | | | | | [ChangeLog][Qt Test] Added keySequence() function. Task-number: QTBUG-53381 Change-Id: Ib7c3f966fe607f00475ae74aaf070cb988d00141 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Document the ci key in the BLACKLIST file formatEdward Welbourne2017-06-081-4/+10
| | | | | | | | | | | | | | | | Rearranged existing top-level example to let the ci example make some kind of sense. Change-Id: I0a5dd6270aef419c8a33d390c801460f23e10667 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | QtTest: add support for printing QStringViewsMarc Mutz2017-04-243-3/+20
| | | | | | | | | | | | | | | | | | [ChangeLog][QtTest][QCOMPARE] Now supports printing QStringViews in case of test failures. Change-Id: I4dc2542cd1013fd63c094c249e721d7102387bde Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QCOMPARE: allow mixed-type comparisonsMarc Mutz2017-04-212-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no reason to restrict the LHS and the RHS to the same type like it was done before. That just leads to lots of casting. or use of QVERIFY(. == .) instead of QCOMPARE, with all the disadvantages like no printing of the LHS and RHS values. The rationale given in the documentation for this behavior is incorrect. Ensuring that RHS and LHS have the same type by no means ensures that no implicit conversions take place when calling operator==. Proof: QCOMPARE(QLatin1Char('a'), QLatin1Char('a')); // instantiates qCompare<QLatin1Char, QLatin1Char> // but calls operator==(QChar, QChar) If the intent is to disable implicit conversions of the argument types, then some serious metaprogramming magic would be needed, along the following lines: 1. find out which op== overload is actually chosen 2. find that overload's RHS parameter type, assert it's the same as (possibly cv-qualified) T1. 3. ditto for the LHS parameter type and T2 This is not attempted here. Fix the inconvenience this restriction caused by simply allowing two types. This cannot break existing code, since we didn't actually change anything in the qCompare() overload set. All we do is implement the existing qCompare<T1, T2>() overload. [ChangeLog][QtTest] QCOMPARE can now be used for mixed-type comparisons. Change-Id: I0413dbd3689809852413eaca22827257f1527720 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-201-0/+6
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.h src/corelib/tools/qdatetime.h src/corelib/tools/qstring.h src/corelib/tools/qversionnumber.h src/plugins/platforms/android/qandroidplatformintegration.cpp tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp Change-Id: Iefd92a435e687a76cd593099e40d9a9620a1454d
| * QtTest: add toString(QUuid)Marc Mutz2017-04-111-0/+6
| | | | | | | | | | | | | | [ChangeLog][QtTest] QUuids are now printed on failure. Change-Id: I39a7b9169aef8ab6ef5ce0790920547af23bd1b9 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | QDate/Time: add toString(QStringView) overloadsMarc Mutz2017-04-121-3/+3
| | | | | | | | | | | | | | | | [ChangeLog][QtCore][QDate/QTime/QDateTime] Added toString() overloads taking the format as a QStringView. Change-Id: I322fa22e6b13fe8ba4badf0a3133425bd067ef32 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Improve pair-like class handling in testsSamuel Gaist2017-04-061-0/+16
|/ | | | | | | | | | | | | | Currently when doing comparison with pair-like classes the fallback toString method is called which returns a Q_NULLPTR thus not allowing proper diagnostic of the values that triggered an error. This patch adds support for QPair and std::pair to improve the tests output readability. [ChangeLog][QtTest][QCOMPARE] Now outputs contents of QPair and std::pair on failure. Change-Id: Ib0b4aad7640590d56275b6f1306fb9fb39fa81bc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Prefer rvalue versions of toLatin() and toUtf8()Anton Kudryavtsev2017-03-301-1/+1
| | | | | | | ... to re-use existing buffers. Change-Id: I7c42529b8cd4400520a59e658ab76f4f8e965cd4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-271-1/+1
|\ | | | | | | Change-Id: Icdd71e9713725bda9c305e338f5c8b41a92ed8e8
| * Fix some warnings found by QNX's compilerThiago Macieira2017-03-251-1/+1
| | | | | | | | | | | | | | | | | | | | -Werror is now disabled for that compiler, but it doesn't hurt to fix. io/qstandardpaths_unix.cpp:149:32: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] qtestcase.cpp:2330:31: error: narrowing conversion of '(ms / 1000)' from 'int' to '_Timet {aka unsigned int}' inside { } [-Werror=narrowing] Change-Id: Id92f4a61915b49ddaee6fffd14aea2c1e686e8f2 Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9Liang Qi2017-03-221-3/+3
|\ \
| * | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-211-3/+3
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/eglfs/eglfs-plugin.pro Change-Id: Id76cdbb41b7758572a3b8ea4dcb40d49bac968db
| | * Use the same timeout value for all QTest::qWaitForWindow*() functionsMarc Mutz2017-03-081-3/+3
| | | | | | | | | | | | | | | | | | | | | Some were 5s, others 1s. Pick one (the higher). Change-Id: I81929d4f49c2e41b4d4b75c3e2bf8ff75af868ad Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Teach QTestLib to read QTEST_ENVIRONMENT to expand blacklist keywordsTor Arne Vestbø2017-03-211-1/+8
|/ / | | | | | | | | | | | | | | | | | | Can be used by CI system to set QTEST_ENVIRONMENT="ci", allowing test to be blacklisted only for the CI. Task-number: QTBUG-59564 Change-Id: I7088abb888c179bafc621f11191efbc45c37b179 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>