summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* QRegularExpression: QMetaType and QVariant supportGiuseppe D'Angelo2012-03-143-0/+29
| | | | | | | | | Removed the Q_DECLARE_METATYPE in favour of first-class support inside QMetaType and QVariant. Change-Id: I904236822bfab967dc0fbd4d4cc2bcb68c741adc Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Silence 'narrowing conversion' warning in testJoão Abecasis2012-03-131-1/+1
| | | | | | | | | | | Seen with gcc 4.6: tst_qarraydata.cpp: In member function 'void tst_QArrayData::grow()': tst_qarraydata.cpp:1445:29: error: narrowing conversion of 'i' from 'size_t {aka long unsigned int}' to 'int' inside { } [-fpermissive] Change-Id: Iad55659554b64ee34655640d606153f058a8cd05 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge "Merge remote-tracking branch 'origin/master' into api_changes" into ↵João Abecasis2012-03-12174-804/+1871
|\ | | | | | | refs/staging/api_changes
| * Merge remote-tracking branch 'origin/master' into api_changesLars Knoll2012-03-12174-804/+1871
| |\ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp Change-Id: I884afc3b6d65c6411733a897a1949e19393573a7
| | * Implement QSystemTrayIcon for Windows.Friedemann Kleint2012-03-121-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No longer base the implementation on a QWidget which is not necessary when all that is required is a message window listening to task-tray messages. Export a service function creating a message window from the Windows native interface and use that. Task-number: QTBUG-20978 Change-Id: I01d0faeac777df4eee802c51d2bc722fce814080 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
| | * Move the auto test of QPixmap::grabWidget() from QPixmap to QWidgetDebao Zhang2012-03-122-43/+75
| | | | | | | | | | | | | | | | | | | | | Change-Id: Id565fa1eb8fe13c62a93a5afa39a5701ce7b20ea QPixmap::grabWidget is deprecated, which calls QWidget::grab() at present. Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
| | * tst_exceptionsafety_objects: add virtual ~AbstractTesterMarc Mutz2012-03-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC complained about undefined behaviour when deleting subclasses of AbstractTester through pointers to AbstractTester, and it's doing so correctly... Change-Id: Ie641281d8aafe32c5c9784e8aa39672ff0b699c7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
| | * Use QAccessibleEvent in test.Frederik Gladhorn2012-03-121-20/+20
| | | | | | | | | | | | | | | Change-Id: I4f9c0f503543caa5704a29c8ccd7c4134b455625 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
| | * Fix indentation of QWaitCondition autotest.Jason McDonald2012-03-121-352/+351
| | | | | | | | | | | | | | | | | | | | | No functional changes - cosmetic change only. Change-Id: I7332eaab31720776c70a7ef813d55db44bab83f7 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| | * Remove gcc 3.x-specific code from QtConcurrent and its tests.Jason McDonald2012-03-122-28/+0
| | | | | | | | | | | | | | | Change-Id: I4dd0ce50b70a47a0a00f4c7ec18077a1bcbe5705 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| | * Move tst_qprinter.cpp to QtPrintSupportDebao Zhang2012-03-1210-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | QPrinter and QPrinterInfo belong to QtPrintSupport. Change-Id: I0c146e0c717be365e752c1eaf7dbe6765fb72da2 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
| | * Clean up some auto tests of guiDebao Zhang2012-03-1210-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | These unit tests do not depent on QtWidget. Change-Id: I95526125c563885c0531da7ebfee06bca9a87b1c Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
| | * Update accessibility StateChange by custom event.Frederik Gladhorn2012-03-121-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | Subclass QAccessibleEvent to give details what changed in the state change. Change-Id: I9005d311e85a3c8bfa6e062833fa6a8a7dc6a4a4 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
| | * Move tst_qicon.cpp and tst_qpixmapfilter.cpp to QtWidgetsDebao Zhang2012-03-1226-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | QIcon and QPixmapFilter belong to QtWidgets instead of QtGui. Change-Id: I6d82811e04046edb0cc67c55970c161612e86d3f Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
| | * Remove outdated assumption from QVariant autotest.Jason McDonald2012-03-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The test was assuming that "data()" is a special function in autotests, but that hasn't been the case since early prototypes of testlib. Change-Id: Ic24cf5dc539b55d12eba0a6ab17173e2ed698f21 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| | * Fix compile warnings in QCoreApplication autotest.Jason McDonald2012-03-121-17/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Use const_cast to avoid "deprecated conversion from string constant to 'char*'" warning when building argv arrays from string literals. - Use Q_UNUSED to avoid warnings on unused local variables. Change-Id: Idd2c8279adc102b6ebc6af7486ba26fe9ed4e7c1 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| | * Remove redundant and incorrect comment from QList autotest.Jason McDonald2012-03-121-6/+0
| | | | | | | | | | | | | | | Change-Id: I3187d0d8ace120181a4c49bbc68f421ddf5acbe0 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| | * testlib: Improve formatting of QCOMPARE failure messages.Jason McDonald2012-03-1221-122/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * Add Q_IS_ENUM(), and provide as flag in QMetaType::typeFlags()Glenn Watson2012-03-112-0/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Q_IS_ENUM() macro to determine if a given type is an enumeration. Use information from that in QMetaType::registerType() to store whether custom registered metatypes are enums or not. This information can then be accessed by calling QMetaType::typeFlags(int type). This is used by the declarative code to determine whether a custom type in a variant can be safely cast to an integer, which is required to allow passing non-local enums as signal/slot params. Change-Id: I9733837f56af201fa3017b4a22b761437a3c0de4 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
| | * Crash fix in QMetaType::typeFlags.Jędrzej Nowacki2012-03-111-0/+6
| | | | | | | | | | | | | | | | | | | | | The function is public, so it should validate input instead of crashing Change-Id: Id67463b0b61ab74a76c1ede7f052bdbed37822b6 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
| | * Make tst_qsql.cpp independent of QtWidgetsDebao Zhang2012-03-112-3/+3
| | | | | | | | | | | | | | | | | | Change-Id: I032902bea6fe2c7d9eb0491886fded7602ae2bcc Reviewed-by: Mark Brand <mabrand@mabrand.nl> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
| | * Make tst_qapplication build when QT_NO_SHAREDMEMORY is definedKevin Krammer2012-03-091-0/+4
| | | | | | | | | | | | | | | Change-Id: I8cfd0ff2e17e6d5c04b81a042c665bcbbca36256 Reviewed-by: David Faure <faure@kde.org>
| | * Windows: Fix QStyleSheetStyle autotest antialiasing issuesMiikka Heikkinen2012-03-092-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Antialiasing of fonts was causing two tests that relied on finding at least a certain number of pixels of certain color to find one or two too few pixels of that color and thus fail. Fixed by increasing the amount of text displayed to make sure enough pixels of correct color would be present. Also removing the test insignification, as the test will now pass completely when run under Windows Classic theme, which CI uses. Task-number: QTBUG-24323 Change-Id: Ic0b614d33e4e4f5df18d53cb72a05db5d8b6b5e7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
| | * Make tst_qmouseevent.cpp independent of QtWidgetsDebao Zhang2012-03-092-13/+9
| | | | | | | | | | | | | | | Change-Id: I6759c7be44c2d890c1a745effdd70faa3467fe5b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
| | * Clean up for some auto tests of the gui/kernel.Debao Zhang2012-03-096-9/+7
| | | | | | | | | | | | | | | | | | | | | They are not dependent on QtWidgets. Change-Id: Icbc0b0b6f0b72537fd3058cc038a1f5c4bf2aba7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
| | * tst_qimagereader: does not depend on QtWidgetsDebao Zhang2012-03-094-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | Both tst_qimagereader.cpp and tst_qimagewriter.cpp do not depend on QtWidgets. Change-Id: I7e8b31c23db203c44ccb4cd4e8e747d18c5d7ed7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
| | * QRegularExpression: minor fix to captureIndexForNameGiuseppe D'Angelo2012-03-082-1/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although passing a null pointer to pcre16_get_stringnumber for the compiled pattern should simply make it error out, it's actually an undocumented behaviour, so let's stay safe and add an explicit check. Tests for this codepath are added. Change-Id: Ifd9c87874f6812ba487104ec1a5bbc83c3b16761 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * QRegularExpression: improve JIT memory handlingGiuseppe D'Angelo2012-03-082-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PCRE's JIT uses by default 32K on the pcre_exec caller's stack. This is fine for most situations, but in some cases (esp. patterns with lot of recursion) more memory is required. Therefore, if a match execution fails due to exhausting JIT memory, we let PCRE allocate up to 512KB to be used for the JIT's stack. The pointer to the allocated memory is put in thread local storage (so it can be reused from the same thread, if needed, and automatically goes away when the thread dies). Change-Id: Ica5fb7d517068befff88ebb198a603a26ec5d8a7 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * use $$QT_BUILD_TREE instead of $$(QTDIR)Oswald Buddenhagen2012-03-081-2/+2
| | | | | | | | | | | | | | | | | | | | | it's a "tad" more reliable Change-Id: I7207daa6869d1682719cc357794cf6efff496225 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
| | * remove strange .qmake.cache hacksOswald Buddenhagen2012-03-085-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | they are obsolete (qmake knows the qt build configuration anyway), and messing with QTDIR is a recipe for disaster. Change-Id: Ib3594f38ec3192a5f70771f8bc5d8fd435bbbd15 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
| | * Windows: Removing insignification from QTextEdit testMiikka Heikkinen2012-03-081-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The commit 660af10dee503729025952ed2374b8a081f941a2 seems to have fixed the test, so removing the insignification from it. Task-number: QTBUG-24348 Change-Id: I564e90db53d10b54e22342a1cdbef6826929c63a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
| | * Fix a bug in the assignment operators for QJsonObject and ArrayLars Knoll2012-03-081-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When objects or arrays where being used read only, several objects can share the same d pointer, but will have different pointers into the binary data. Correctly change the pointer into the binary data even if the d-pointer is the same. Change-Id: Ife0ea5ac5daf46586f855dccdf35b51ec696a623 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
| | * Crash fix in QMetaType::typeName.Jędrzej Nowacki2012-03-081-4/+8
| | | | | | | | | | | | | | | | | | | | | The function is public, so it should validate input instead of crashing Change-Id: Ifd9f1110f8631f942929d85db6a57eee7afffb6a Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
| | * Fix crash in QVariant::canConvert.Jędrzej Nowacki2012-03-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | The function was crashing when an unsupported type id was given as an input argument. Change-Id: I2b0e3e6d43f6f248dc71532f8e6485efe68e8120 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
| | * Windows: Make QMenuBar autotest significant againDebao Zhang2012-03-081-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The bug has been fix by 7bc576771de0b3c96905a6d11a75a01917334dc9 . Task-number: QTBUG-24326 Change-Id: Ifd37e9fe76cb24e49132f22909c95a55a230b1ed Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
| | * Remove usage of QtXml from rcc, add testGiuseppe D'Angelo2012-03-0845-16/+746
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ported from QDom to QXmlStreamReader. This enables removal of QtXml classes from bootstrap. A new rcc test was added, copying the data from the QResourceFileEngine test. The new test runs rcc to create binary resources, dynamically loads them under various locales and checks that they do contain the expected files. Change-Id: I15d23dfda45de851a421156951ce2a60af4c1f7f Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: hjk <qthjk@ovi.com>
| | * Call updateAccessibility with the right index.Frederik Gladhorn2012-03-081-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt 4 index 0 was the widget itself. With the cleanup of child index this now changed. The default constructor uses -1 as parameter to signify that the widget is the cause, not a child. Change-Id: I329a1cc91bf2d1d1d8534739acbddfe107f40364 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
| | * selftests: Improve reporting of problems with loading expected outputJason McDonald2012-03-081-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the expected output file was missing (e.g. not included in selftests.qrc), tst_selftests would trigger an assert inside QList by calling QList::at() on an empty list. Make tst_selftests detect this error instead and give a meaningful error message. When loading expected output for the crashes selftest, where there are several alternative versions of the expected output, the code reused the "exp" variable when loading the alternative test output files. This caused the last file loaded to be used unintentionally if none of the alternative files had the correct number of lines. Use a different variable so that exp remains empty if none of the alternatives are valid and a failure can be reported. Change-Id: I35b2a3d905d069d3ee8dcb1447836eb68d5c8612 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| | * testlib: Improve verbose and XPASS outputJason McDonald2012-03-089-35/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * Mark unstable windows network testsShane Kearns2012-03-086-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is unfortunately still "most of them", because of QTBUG-24451 however some of the unit tests are still possible to test stably. Also skipped test cases which would hang forever due to QTBUG-24451. Bearer tests are not run, because they pass when test machine has no wireless LAN, but fail or hang if it does (QTBUG-24503) Change-Id: Icf99d45707102d2ef9219ed0b5ad521605716219 Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| | * Rework QNetworkProxyFactory::systemProxyForQuery autotestShane Kearns2012-03-081-21/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than requiring specific hardcoded proxies in the system, it now checks the proxies returned by the system have the required capabilities for the request. Note the test will pass if no proxy is configured (as QNetworkProxy::NoProxy has all required capabilities) The test prints the returned proxy lists and elapsed time diagnostic for manual comparison and debugging. Change-Id: I621ef4d1d7264a98c3e8bd485c30bc1166fcbdf0 Task-number: QTBUG-19454 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Mark tst_QNetworkReply::getThenDeleteObject as unstableShane Kearns2012-03-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's unstable on all platforms, because the reply can be finished due to a race with the http thread. It isn't crashing (which the test was trying to test for), but rather the QVERIFY(!reply->isFinished()) fails, which is an inconclusive verdict. Change-Id: Ib815a7cedd220544a0c9cb83023e3334df4a0fb3 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
| | * tst_qnetworkreply - remove qRegisterMetaType duplicatesShane Kearns2012-03-081-28/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The metatypes are registered in the constructor, don't need to register them in test cases as well. Registering in a test case is bad practice, as it could result in tests failing when run individually due to unknown metatype. Change-Id: Ic4d65d0f5fe3cdd3ab57cf2512a4906d71205a05 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
| | * Add windows XFAIL to qnetworkreply autotestShane Kearns2012-03-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | The test case that depends on QLocalSocket consistently fails due to bugs in QLocalSocket windows implementation Change-Id: Ibfe9eb3590be4f72b52f14cd4fbe5be61f6cf70e Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
| | * chiptester benchmark: compileMarc Mutz2012-03-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The implementation uses QScrollBar, which is no longer included by <QtGui>. Change-Id: I2422cfccc427179ca71e9a3195f16bd637925fb3 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
| | * examples: use QVector<QPointF> instead of QList<QPointF>Marc Mutz2012-03-083-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPointF is in the category of types for which QList is needlessly inefficient (elements are copy-constructed onto the heap and held through pointers). Use a vector instead. This is consistent with the QPainter API. Change-Id: Id0e910c067a60d12fbc175e7ee7da824834be374 Reviewed-by: hjk <qthjk@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | | Fix QString:mid and midRef, againJoão Abecasis2012-03-121-8/+44
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 75286739 it was assumed that negative positions shouldn't influence the size of the returned substring. That however changes behaviour that was depended on even inside Qt. With this change, the old behaviour is reestablished. A negative value of n is still taken to mean "all the way to the end", regardless of position, and overflows are still avoided. Change-Id: I7d6ed17cc5e274c7c7ddf0eb0c3238e1159ec4f6 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* | QtDBus: make some constructors explicitMarc Mutz2012-03-121-19/+19
| | | | | | | | | | | | | | | | | | This is a semi-automatic search, so I'm reasonably sure that all the exported ones have been caught. Change-Id: I314d341ad0db4e9d4bbf353a9537c9422ad8a54b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Mark tst_qtimeline as insignificant on WindowsSergio Ahumada2012-03-091-0/+2
| | | | | | | | | | | | Change-Id: If8f699f867d3950cced17b150cb5f02fddd1f9a8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* | Merge "Merge remote-tracking branch 'origin/containers' into api_changes" ↵Friedemann Kleint2012-03-0920-97/+2541
|\ \ | | | | | | | | | into refs/staging/api_changes