summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtest.h
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Add qtest_network.hMarc Mutz2016-09-291-24/+4
| | | | | | | | | | | | | | | | | | | | | | | ... and move toString() implementations there which were repeated in network tests, or #ifdef'ed in qtest.h. Since the functions moved from network tests are now in a public header, had to massage them a bit to pass headersclean: - replace Q_FOREACH with C++11 range-for - avoid implicit conversion from QByteArray -> const char* (done by re-using toString(QByteArray) instead of calling strdup() manually) Also made the functions overloads instead of specializations. This allows to pass the enum by value instead of by const-&. Like the existing QHostAddress, the newly-added toString() overloads are marked as \internal. We can decide later whether to turn them into public API. Change-Id: I8c23db7a0a6575273567017d42d7b2a957acece8 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-07-191-7/+27
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakebuiltins.cpp qmake/library/qmakeevaluator.cpp qmake/library/qmakeevaluator.h qmake/project.h QMakeEvaluator: * evaluateConditional(): one side changed return type, the other changed a parameter type. * split_value_list(): one side changed a parameter adjacent to where ... * expandVariableReferences(): ... the other killed one overload and changed the survivor src/corelib/io/qlockfile_unix.cpp One side changed a #if condition, the other moved NETBSD's part of what it controlled. src/corelib/tools/qdatetime.cpp One side fixed a reachable Q_UNREACHABLE in toMSecsSinceEpoch(), the other moved it from the private class to the public one, in the midst of the "short date-time" optimization, which confused diff entirely. One side changed a QStringLiteral to QLatin1String, the other rewrote adjoining code. src/network/kernel/qauthenticator.cpp Both rewrote a line, equivalently; kept the dev version. src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h One side changed #if-ery that the other removed. tools/configure/configureapp.cpp One side added a check to -target parsing; the other killed -target. tests/auto/testlib/selftests/expected_cmptest.lightxml tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/testlib/selftests/expected_cmptest.xml tests/auto/testlib/selftests/expected_cmptest.xunitxml Regenerated using generate_expected_output.py I note that quite a few other expected_* come out changed, now. There was no git-conflict in src/widgets/kernel/qformlayout.cpp but it didn't compile; one side removed some unused methods; the other found uses for one of them. Put FixedColumnMatrix<>::removeRow(int) back for its new user. Change-Id: I8cc2a71add48c0a848e13cfc47b5a7754e8ca584
| * Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-151-6/+26
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakeevaluator.cpp One side changed the iterator to use ranged-for, the other changed its body; they only conflicted because the latter had to add braces around the body, intruding on the for-line. Trivial resolution. Change-Id: Ib487bc3bd6e3c5225db15f94b9a8f6caaa33456b
| | * Testlib: Replace QString::arg() formatting by snprintf()Friedemann Kleint2016-07-081-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Formatting of values needs to be fast since QTestlib always pessimistically formats the values passed to QCOMPARE even if they match. Speeds up tst_qrect by factor 1.5..2. Task-number: QTBUG-38890 Change-Id: I3627db77a305a46c1d51a14c04b88db8018faa60 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | Use QStringLiteral more judiciouslyAnton Kudryavtsev2016-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace it with QL1S in QStringBuilder expressions and in overloaded functions. Replace patterns 'QString::number() + QStringLiteral' and 'QStringLiteral + QString::number()' with QString::asprintf. Saves some text size. Change-Id: Ib39b2332264dfc3df04e77f2c101b47a1030cef4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-131-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure mkspecs/features/uikit/sdk.prf src/corelib/global/qhooks.cpp src/corelib/io/qfilesystemwatcher.cpp src/corelib/io/qlockfile_unix.cpp src/corelib/tools/qalgorithms.h src/gui/kernel/qwindowsysteminterface.h src/gui/text/qtextdocument_p.cpp src/network/access/access.pri src/network/access/qnetworkaccessmanager.cpp src/network/access/qnetworkreplynsurlconnectionimpl.mm src/src.pro src/testlib/qtestcase.cpp src/widgets/kernel/qwidgetbackingstore_p.h src/widgets/styles/qwindowscestyle.cpp src/widgets/styles/qwindowsmobilestyle.cpp tests/auto/corelib/io/qdiriterator/qdiriterator.pro tests/auto/corelib/io/qfileinfo/qfileinfo.pro tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp tools/configure/configureapp.cpp Change-Id: Ibf7fb9c8cf263a810ade82f821345d0725c57c67
| * | Do an actual toString conversion for QVariant test failuresAllan Sandfeld Jensen2016-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | A cast is not a conversion. If the value is not already a string type we are just getting an empty string for all metatypes that can be converted to string. Change-Id: I4643cc9fd509c21568fdc2133403c3ed8cb38a10 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-031-0/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/3rdparty/double-conversion/include/double-conversion/utils.h src/corelib/global/qnamespace.qdoc src/corelib/tools/qsimd_p.h tests/auto/corelib/io/qfile/tst_qfile.cpp Change-Id: I3ca1007bab5355d251c13002a18e93d81c254d34
| * | Fix some qdoc-warnings in 5.7.Friedemann Kleint2016-04-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtbase/src/corelib/global/qnamespace.qdoc:101: warning: Undocumented enum item 'AA_SynthesizeMouseForUnhandledTabletEvents' in Qt::ApplicationAttribute qtbase/src/corelib/global/qnamespace.qdoc:2554: warning: Undocumented enum item 'ImAnchorRectangle' in Qt::InputMethodQuery qtbase/src/corelib/statemachine/qsignaltransition.cpp:154: warning: Can't link to 'Q_COMPILER_DELEGATING_CONSTRUCTORS' qtbase/src/gui/image/qiconloader.cpp:160: warning: Cannot find 'QIconCacheGtkReader' specified with '\class' in any header file qtbase/src/gui/painting/qpaintengine_raster.cpp:1382: warning: No documentation for 'QRasterPaintEngine::fillPath(const QPainterPath &path, QSpanData *fillData)' qtbase/src/testlib/qtest.h:176: warning: No documentation for 'QTest::toString(const QHostAddress &addr)' qtbase/src/testlib/qtest_gui.h:77: warning: No documentation for 'QTest::toString(const QColor &color)' Change-Id: If9ac0807accf2530ec7fc2ca7db71a110f9f79bb Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | | QTest: support nullptr in QCOMPAREMarc Mutz2016-04-081-0/+5
|/ / | | | | | | | | | | | | | | | | | | | | This allows to write QCOMPARE(ptr, nullptr); instead of QVERIFY(ptr); Task-number: QTBUG-49973 Change-Id: I6e1327d4327bcf17bd9b59de4352fdcaae98ac27 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Add Intel copyright to files that Intel has had non-trivial contributionThiago Macieira2016-01-211-0/+1
| | | | | | | | | | | | | | | | | | I wrote a script to help find the files, but I reviewed the contributions manually to be sure I wasn't claiming copyright for search & replace, adding Q_DECL_NOTHROW or adding "We mean it" headers. Change-Id: I7a9e11d7b64a4cc78e24ffff142b506368fc8842 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QtTest: Add QHostAddress support for QCOMPARE failuresThiago Macieira2015-08-151-0/+20
| | | | | Change-Id: Iee8cbc07c4434ce9b560ffff13cc6dad04a5a554 Reviewed-by: Richard J. Moore <rich@kde.org>
* QtTestLib: Use Q_NULLPTR instead of 0 in all public headersMarc Mutz2015-07-061-1/+1
| | | | | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Since QtTestLib has a lot of templates and macros, not all uses of 0 as nullptr might have been detected by the headersclean check. Task-number: QTBUG-45291 Change-Id: I21e9d8822e3a708010938e8d5ef2fd42ae6c8c68 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Add GPU_BLACKLIST support to QTestLibLaszlo Agocs2015-05-081-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | In addition to BLACKLIST, Qt will now look for GPU_BLACKLIST too. Test cases that are specified as disabled in the GPU blacklist will be skipped. This is particularly relevant when running tests on Embedded Linux devices. For example, the following JSON would configure the test case glxContextWrap to be skipped on drivers where GL_VENDOR contains UnstableDriverVendor: { "entries": [ { "gl_vendor": "UnstableDriverVendor", "features": [ "disable_glxContextWrap" ] } ] } In contrast to the regular blacklist, GPU-blacklisted test cases are not run at all. This is because driver problems and instabilities often lead to crashes. Change-Id: I340cf5c0261a206109b78409774408981bba5c68 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* TestCase: Also check main source path when looking for test dataCaroline Chao2015-05-051-0/+11
| | | | | | | | | | | This is for example useful when looking for a possible BLACKLIST file while doing a shadow build. Add autotests for blacklist. Change-Id: I41d3939d31d21d10187fefcb82604736d911b6ad Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Make the printing of complex byte arrays prettierThiago Macieira2015-02-151-1/+1
| | | | | | | | | | | | Similar to what we've done to QString, only we print each byte that is not ASCII as \OOO (octal representation). [ChangeLog][QtTest] QtTest now prints an escaped version of QByteArrays that failed to compare with QCOMPARE, instead of the hex dump. Change-Id: I6a8c43f138c66c998280998a242b43cd579666a0 Reviewed-by: Richard J. Moore <rich@kde.org>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-01-211-2/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/global.pri src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.h src/corelib/tools/qdatetime.cpp src/plugins/platforms/xcb/qxcbscreen.h src/plugins/platforms/xcb/qxcbwindow.h src/widgets/dialogs/qcolordialog.cpp src/widgets/dialogs/qcolordialog_p.h tools/configure/configureapp.cpp Change-Id: Ie9d6e9df13e570da0a90a67745a0d05f46c532af
| * Autotest: Selftests fail in UTC timezoneRainer Keller2015-01-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | Selftests for testlib fail when executed in UTC timezone because local and UTC are the same, but expected to be different. A custom timezone is used instead. Debug output of qCompare does only handle local and non-local timezones, using new Qt5 features allows to show the correct timezone in format string. Change-Id: I753884a12370952b7b62a90d62896db4f2d3d1b4 Reviewed-by: Jason McDonald <macadder1@gmail.com>
* | qtest.h: actually include qtest_widgets.hMarc Mutz2014-12-261-1/+1
|/ | | | | | | | | | | Was including qtest_gui.h instead, for QT_WIDGETS_LIB. Not a problem in practice, since qtest_widgets.h doesn't currently add anything on top of qtest_gui.h. But that will change soon. Change-Id: I942870cddc7b1ccfda262e2fe26834594336dd0b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make QVersionNumber privateThiago Macieira2014-11-131-6/+0
| | | | | | | | | | We're not ready. [ChangeLog][EDITORIAL] Remove all mentions of QVersionNumber. Change-Id: I03ad95992982eb3177f982c1eeddb6a6bc29336c Reviewed-by: Keith Gardner <kreios4004@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Long live QVersionNumber!Keith Gardner2014-08-091-0/+6
| | | | | | | | | | | | The class provides compare operators, stream operators, and hashing functions. This class aims to be compatible with (but not restricted to) the Semantic Versioning 2.0 standard (semver.org). [ChangeLog][QtCore] Added QVersionNumber class Done-with: Marc Mutz <marc.mutz@kdab.com> Change-Id: I244c8ccc002909af03987a2df052734d1a8621a9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Testlib: Fix minor leak and crash when comparing listsStanislav Ionascu2014-05-061-2/+8
| | | | | | | | | | 1) toString does not track the string it returns, thus it has to be deleted by the caller 2) on some platforms vsnprintf crashes if a null string is in the va_list Change-Id: Iecf94e93d3a2ddf4186ee20de1f495f2f92dcc60 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make the printing of complex Unicode in a QString prettierThiago Macieira2014-02-161-8/+8
| | | | | | | | | | | | | | | This also has the advantage of not requiring the use of the locale codec. Quite an advantage if you're debugging the locale codec. But it's mostly so that we don't get question marks that hide the difference we were trying to locate. [ChangeLog][QtTest] QtTest now prints an escaped version of QStrings that failed to compare with QCOMPARE. That is, instead of converting non-printable characters to question marks, QtTest will print the Unicode representation of the character in question. Change-Id: I44c1ef3246b188c913dacd3ca4df02581356ea41 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* make testlib's toString() use local8Bit, not latin1Oswald Buddenhagen2013-03-131-9/+9
| | | | | | | | | | | this is consistent with what qDebug does. consequently, this makes the code usable with 8-bit strings in the first place. note that some {to,from}Latin1 is left - this is where we know that we are dealing with ascii-only text. Change-Id: I26cfdf3622250b8bf95ebfe221465ca89d7cd082 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Allow QtTest's QCOMPARE to work with mixed q(u)int32 and q(u)int64Jon Severinsson2013-02-111-0/+42
| | | | | | | | | | Change-Id: I491edcae84c149775cf3640626ccff8cbf0d69fe Reviewed-by: Jon Severinsson <jon@severinsson.net> Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Jason McDonald <macadder1@gmail.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-221-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QTestLib: improve output when comparing lists fails.David Faure2013-01-221-8/+15
|/ | | | | | | | | | | | | | | | | | | | Only QStringList was handled before, now any QList is handled. A specialization for QStringList is still needed though, due to the way template matching works. Example with QList<int>. Before: FAIL! : tst_QTextCodec::threadSafety() Compared values are not the same Loc: [../tst_qtextcodec.cpp(2057)] After: FAIL! : tst_QTextCodec::threadSafety() Compared lists differ at index 0. Actual (res2.toList()): '0' Expected (mibList): '3' Loc: [../tst_qtextcodec.cpp(2057)] Change-Id: If0fdec3236ddb78a679ee549aba569ef5571c395 Reviewed-by: Jason McDonald <macadder1@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Make QUrl::errorString() usable for QtTest output in invalid URLsThiago Macieira2012-10-021-0/+2
| | | | | | | | | If an URL is invalid, let's indicate that in the test output. To be helpful, let's make QUrl::errorString() include the component form of the URL. Change-Id: Iaafe16973ded79c7ea688fbb23808d91253e8c14 Reviewed-by: David Faure <faure@kde.org>
* qtest.h: add missing QT_NO_DATESTRING guardsJ-P Nurmi2012-09-261-0/+2
| | | | | Change-Id: I04d8ec2e9d41399cffc610f943fc06e043831ceb Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* QTestLib: clean up qCompare specialisation/overload mixMarc Mutz2012-09-231-2/+2
| | | | | | | | | | | | | qCompare() was both overloaded and specialised, but always as a template. This lead to the QIcon specialisation actually invoking qCompare(QFlags<void*>, ...) when specifically asking for qCompare<void*>() (detected by adding underlying-type detection to QFlags). Fix by preferring overloading and not specialising anything. Change-Id: Ie001ebb9dfb0847c6c33a3f45177a61579fd61ee Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change the component formatting enum values so the default is zeroThiago Macieira2012-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | By having the default value equal to zero, we follow the principle of least surprise. For example, if we had url.path() and we refactored to url.path(QUrl::DecodeSpaces) Then instead of ensuring spaces are decoded, we make spaces the only thing encoded (unicode, delimiters and reserved characters are encoded). Besides, modifying the default can only be used to encode something that wasn't encoded previously, so having the enums as Encode makes more sense. As a side-effect, toEncoded() does not support any extra encoding options. Change-Id: I2624ec446e65c2d979e9ca2f81bd3db22b00bb13 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Merge QUrl::DecodeAllDelimiters and QUrl::DecodeUnambiguousDelimitersThiago Macieira2012-04-111-1/+1
| | | | | | | | | | | | | | | | | | | There's little value in having the DecodeUnambiguousDelimiters option since neither QUrl nor QUrlQuery can return values that are ambiguous in that particular context, ever. This option could be used to encode a character if, when placed in a URL, it would need to be encoded. Such cases are hash (#) or question marks (?) in the path component, or slashes (/) and at signs (@) in the userinfo. However, we don't need two enums for that, since there are no other characters that can appear in either form. Still, leave two bits for this enum. In the future, if we want to split the gen-delims from the sub-delims, we are able to. Change-Id: If5416b524680eb67dd4abbe7d072ca0ef7218506 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Port to the new QUrl APIThiago Macieira2012-03-301-1/+1
| | | | | | | | | | | | | | The use of any broken-down components of the query now needs QUrlQuery. The QUrl constructor and toString() are now rehabilitated and the preferred forms. Use toEncoded() and fromEncoded() now only when we need to store data in a QByteArray or the data comes from a QByteArray anyway. Change to toString() or the constructor if the data was in a QString. Change-Id: I9d761a628bef9c70185a48e927a61779a1642342 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove QTEST_NO_SPECIALIZATIONSOlivier Goffart2012-03-141-4/+0
| | | | | | | | We don't support these compiler anymore Change-Id: I0eb73535b6c11703299430e5fc24c8e17fed1653 Reviewed-by: Samuli Piippo <samuli.piippo@digia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* testlib: Improve formatting of QCOMPARE failure messages.Jason McDonald2012-03-121-3/+3
| | | | | | | | | | | Make the various versions of the failure message align consistently so that it's a little easier to compare the actual and expected values. Of course, the value won't align nicely unless the "actual" and "expected" strings are the same length, but at least this commit makes that consistent across all versions of the message. Change-Id: If9ce231df3b5d279a06f6458fdb5da0aa4586068 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* testlib: Improve verbose and XPASS outputJason McDonald2012-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, verbose (-v2) and XPASS test output showed all QCOMPAREs as "COMPARE()", making it impossible to see what was compared and difficult to match the output to the source of a test containing many calls to QCOMPARE. This commit changes testlib's internal compare_helper API so that string representations of the compared expressions are always passed to QTestResult::compare() when available, and can thus be shown in the verbose and XPASS output. The XPASS output has also been changed to state explicitly that the comparison succeeded unexpectedly, bringing it in line with the XPASS output resulting from a call to QVERIFY. This commit also changes all calls to compare_helper() to call the eight-argument version of the function, which simplifies much of the calling code. The now obsolete four-argument version of compare_helper() has been changed to output a warning that it is obsolete. It will be removed once other modules have had some time to catch up. The improved XPASS and verbose output is demonstrated by the expectfail and verbose2 selftests. Change-Id: I8baa46d5dd30e6c43b26f366c34dc5b64aab5f7c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-251-1/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QStyleHelper: Base DPI-calculation on QScreen.Friedemann Kleint2012-01-111-0/+4
| | | | | | | | | | | | | | | - Use qt_defaultDpiX() to obtain the resolution, which obtains it from QScreen. This implies that for X11, which previously used a hardcoded default of 96 DPI, the real resolution will be used (typically 75). - Since many tests (layouts, graphicsview) contain test data for 96 DPI, add an attribute to QCoreApplication making it possible to set the resolution to 96 DPI for testing. Change-Id: I77c8233a96b0d75de07406f58d48886a89c3de06 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Improve QCOMPARE for QStringListJason McDonald2011-12-151-6/+7
| | | | | | | | | After establishing that both lists are the same size, there is no need to calculate the minimum of the list sizes. Also, use sizeof() instead of hard-coded values when calling qsnprintf(). Change-Id: I2396cf3f941770229e1cef6422aeddbe549c51fc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Stop using QTest::qt_snprintf() in testlib.Jason McDonald2011-12-121-7/+7
| | | | | | | | After the previous commit, QTest::qt_snprintf() is equivalent to qsnprintf(), so just use that instead. Change-Id: I89ad6e3749ba5efb1926b0b618a904e8baca9f52 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>