summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* QCursor: Associate cursor with screen.Friedemann Kleint2012-03-073-12/+10
| | | | | | | | | | | | | | | | | | | | | | - Introduce cursor() accessor to QPlatformScreen. - Remove screen member of QPlatformCursor (a cursor can be shared by multiple screens of a virtual desktop). - Add QCursor::pos()/ QCursor::setPos() taking a QScreen-parameter, use primaryScreen() for old overloads. QCursor::pos() can then query the platform cursor for the position and return the position even if the mouse position is outside the windows owned by the Qt application. - Fix tests Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Task-number: QTBUG-22457 Task-number: QTBUG-22565 Task-number: QTBUG-20753 Change-Id: Ia69f37343f95772e934eab1cd806bd54cbdbbe51 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix dockwidgets behavior when window resized or central widgets is set.Debao Zhang2012-03-071-0/+5
| | | | | | | | | | | | | | | When adding and showing a central widget in a QMainWindow then the layout does not respect the size policy of the central widget. This is a side effect of 059be19781a22d2e41f22072152589857d0fabf9 After the layout of QMainWindow is restored or the separator between central widget and dock widgets is moved by user, dock widgets should keep their size when the window if resized. Task-number: QTBUG-15689 Change-Id: Idfccb7b4ae057a99f431c2ed54e3b9fcfb6ef54c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* QRegularExpression: add optimizations autotestGiuseppe D'Angelo2012-03-078-44/+213
| | | | | | | | | | | | | | | Exporting the counter that controls the optimization of a compiled pattern lets us to forcibly optimize all patterns. Therefore, two tests are now run: one with default optimization values and another one which always optimizes the pattern. The counter itself was renamed with a qt_ prefix and put inside the Qt compilation namespace (thanks to rohanpm for pointing it out). Change-Id: I56602433d37adc127772b2d0d2cdaf2e49d43c71 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix deadlock in QPropertyAnimationOlivier Goffart2012-03-071-0/+45
| | | | | | | | | | Commit 1e6514a714c1f55b9cb57d2b8b65bc2305c2e2c6 changed the mutex from recursive to non-recursive, which could introduce dead lock if the animation starts other animation (This is the case in QMainWindow layouts) Change-Id: I1b149b78a802748eb24b5700fffeca0b8555f005 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Add fonts to QPlatformTheme.Friedemann Kleint2012-03-072-7/+3
| | | | | | | | | | | | | | | | - Remove QPlatformFontDatabase::defaultFonts() returning a hash containing widget name ->font and the Windows implementation. - Add enumeration and font accessor to QPlatformTheme. The value returned for the enumeration value overwrites the default font of the font database. - Implement for Windows, Mac and KDE. - Add more Windows palettes. Task-number: QTBUG-23686 Change-Id: I8a2abdfd216df23daa7c9630c54264cdf61295db Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Make QCursor manual tests compile on Qt5Miikka Heikkinen2012-03-076-6/+6
| | | | | | | These tests were not aware widgets had been split to different lib. Change-Id: I58bde1304c876319a3cbb50f4d6a66e9f24b2886 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove abuse of QMetaTypeId from tst_qshortcut test.Jędrzej Nowacki2012-03-071-39/+34
| | | | | | | | | Q_DECLARE_METATYPE macro is much better for a custom type registration then a handwritten template specialization. Change-Id: Ia15688d89f708fbff0c1da93e08052d31f3b3fc0 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Improve type detection for query resultsAndy Shaw2012-03-071-0/+118
| | | | | | | | | | | | | | When an aggregate function is used for a column in a SQL resultset then it should ensure that the right data type is reported for that column. This also concerns expressions when the returned column does not map directly to a table column. Test included for this. Task-number: QTBUG-22038 Change-Id: I07487694c0ed393d46af06e232914fe923356a99 Reviewed-by: Mark Brand <mabrand@mabrand.nl> Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
* Refactor headersclean for usage from modules other than qtbaseRohan McGovern2012-03-076-60/+176
| | | | | | | | | | | | headersclean enforces various rules which all Qt headers are supposed to abide by. It fails compilation if these rules are broken. These rules should be followed also by modules hosted outside of qtbase. Split the test up so that it can be easily reused by other modules. Change-Id: Icf09cbfde411c926ed87914dc821e6dfc569b0de Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Add benchmark for QMetaType::create().Jędrzej Nowacki2012-03-071-0/+21
| | | | | | | A case of a custom type creation was not covered before. Change-Id: Icd2a7d63633f8e40d9d4a8a26e0eb0896fc85ec8 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Fix parsing of unicode escape sequencesLars Knoll2012-03-072-0/+16
| | | | | Change-Id: I63a7cd3a571fb47c97157bcb2ca29c4239c600ba Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QRegularExpression: fix autotestGiuseppe D'Angelo2012-03-071-2/+3
| | | | | | | | | | | | Some minor fixes: obviously, a valid match always come from a valid regular expression, but a valid regular expression can create an invalid match (internal error during matching). Also, testing an invalid iterator should silence the emitted warnings. Change-Id: I585bb99a81e22f108601fd66bf30b56e0229d68b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSqlTableModel: use selectRow() for field and row edit strategiesMark Brand2012-03-072-14/+76
| | | | | | | | | | | | | | | | Calling select refreshes the query data but disrupts view navigation. For OnFieldChange and OnRecordChange it makes sense to only select the row in question. This does not disturb view navigation. Assume disruption of view navigation is not a problem for OnManualSubmit because the user or application decides when submitAll is called. Task-number: QTBUG-2875 Change-Id: I1e5f68668fb9102f6296d67d543e80daa403f1c4 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* QSqlTableModel: handle changes between submit and selectMark Brand2012-03-071-4/+4
| | | | | | | | | | | | | | | | | | | | Once an insert has been submitted, the cached record behaves like an update. For row bookkeeping, we still have to remember that it was originally inserted and is not in the query rows. Between submitting a delete and selecting, we remove the values from the deleted record. This causes a blank row to be displayed. Read-only flag is set for cells in deleted row. Reverting between submit and select means going back to the last submitted values. When removing rows, it's better to process from highest row numbers to lowest. This avoids complications with higher rows shifting down when lower rows are removed. Change-Id: I8752fa11f7a1b88f2a71b9e03a020ac37e62487f Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
* QRegularExpression: add captureCount()Giuseppe D'Angelo2012-03-061-0/+31
| | | | | | | | QRegularExpression::captureCount() returns the number of capturing groups inside the regular expression pattern. Change-Id: Ib90ce67c67d06ab2966f0c98bd91da21defc156d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QRegularExpression: improve operator==, add dedicated autotestGiuseppe D'Angelo2012-03-061-5/+59
| | | | | | | | Trivial change: compare dpointers first, then the data. Added test function for operator==. Change-Id: I33ac64a59db4ccad56c30be17622187e42415f38 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>