summaryrefslogtreecommitdiffstats
path: root/tests/auto
Commit message (Collapse)AuthorAgeFilesLines
* add $$reverse() functionOswald Buddenhagen2012-06-191-0/+2
| | | | | | | | | returns the list with the order of the elements reversed. one can easily implement this with existing functions, but this is way faster and more readable. Change-Id: I12d306eb9fe58fc332622274ea6b658192529491 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* add $$shell_quote() functionOswald Buddenhagen2012-06-191-0/+8
| | | | | | | | to be used in system() calls and when assembling EXTRA_COMPILER and INSTALLS .commands by hand. Change-Id: Id706cd56aa267a9fb4b14e3416692b4716fafa5b Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$absolute_path() and $$relative_path()Oswald Buddenhagen2012-06-191-0/+5
| | | | | | | just exposes QDir::fooFilePath() wrapped into QDir::cleanPath() Change-Id: I7a7644084825fd8092a9910ac20f695c4d9351f6 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$native_path() functionOswald Buddenhagen2012-06-191-0/+2
| | | | | | | more or less QDir::toNativeSeparators(QDir::cleanPath()) Change-Id: I52deee1e8086559eda5833b387a0cf64d21cbcd9 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$clean_path() functionOswald Buddenhagen2012-06-191-0/+2
| | | | | | | just QDir::cleanPath() Change-Id: I2d51e2385939d8926c00f296537ab7f6757d9a79 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$format_number() functionOswald Buddenhagen2012-06-191-0/+14
| | | | | Change-Id: I04266c1f5fb72af94073f3f508cee59085e365b6 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$shadowed() functionOswald Buddenhagen2012-06-192-1/+3
| | | | | | | | | return the build directory corresponding to a given source directory. this is the identity function if not shadow-building. if input lies outside the source directory, return empty value. Change-Id: I2d2a6b1112bd19989fe29cfe19a12d39a0d208c1 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$val_escape() functionOswald Buddenhagen2012-06-191-0/+9
| | | | | | | | this quotes the elements of a variable in a way suitable for re-parsing as qmake code. Change-Id: I0e6ea2478c43b5aeff45f485a48ac8c86705dd4a Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add mkpath() functionOswald Buddenhagen2012-06-191-0/+4
| | | | | Change-Id: I8809b9ee4e85fbe8cec95641d659f237c5f51a26 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add write_file() functionOswald Buddenhagen2012-06-191-1/+15
| | | | | | | | | this dumps the contents of a variable into a file. each element of the variable is considered a line; line terminators are added. all missing directories are automatically created. Change-Id: Idafeb873cea64e6705c894b3ab0ef21df69e7170 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* remove some qmake -project boilerplate from project filesOswald Buddenhagen2012-06-194-11/+1
| | | | | Change-Id: I5e6103db42b4fcca4ed4c2ffaec71e71e73d5b95 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Fix tst_qfile opening of stdin/out/err: don't assumeThiago Macieira2012-06-181-29/+38
| | | | | | | | | | The standard streams can be redirected to a file, so don't assume anything, but try to get the actual size and position from the OS and from the C library (stdout is usually buffered, so the result of lseek might be different from ftell). Change-Id: Ice4a0aa21726671928f56a13cc07cc0e4b52091d Reviewed-by: Richard J. Moore <rich@kde.org>
* tst_QChar: drop outdated testcaseKonstantin Ritt2012-06-161-7/+0
| | | | | Change-Id: I0c06643165b299c552c697f400608e29ae4e7f7a Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make QTBF autotest support SMP code points in the test dataKonstantin Ritt2012-06-161-2/+6
| | | | | | | | I didn't do this earlier since the current test data doesn't contain any SMP code points, the Unicode 6.2 test data does - so, I can confirm this code really works. Change-Id: Ieae35e8480a89e22d846fd038e79592fefbbf2ee Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add automatic metatype declaration for QPointer and QWeakPointer.Stephen Kelly2012-06-151-8/+18
| | | | | Change-Id: Ic9a04fa68d0bb14ef07455a6559e59f4b887f38b Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Fix QListView::scrollTo() when there are hidden rowsJani Honkonen2012-06-141-0/+48
| | | | | | | | | | | | | | | | | This is a cherry-pick of b0601630dd0ddabfaa3b97d042ee02b981d95988 from February QListView does not consider hidden rows when scrolling to an item. If there are hidden rows (or columns) before the selected item then the visual index of an item is not the same as the row index from the model. So scrolling will be off by the number of hidden rows before the selected item. Added a autotest for this also. Task-number: QTBUG-21115 Change-Id: I01b097bce7f163cdb480a71b763c060cc006fdc7 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Rewrite QNetworkReply downloadProgress autotestShane Kearns2012-06-141-54/+56
| | | | | | | | | | | The existing autotest was made invalid by the downloadProgress signal choking patch. Rewrote the autotest to download files from the test server with some rate limiting applied to ensure more than one signal is emitted. Change-Id: I6026bacdf356b4e1796b80f6983e5bdce0d1bfce Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* choke uploadProgress signalsShane Kearns2012-06-141-1/+4
| | | | | | | | | | | | | | | | | | The QNetworkReply::uploadProgress signal is intended for updating UI elements such as a progress bar. Limit the signal emissions to 10 per second to prevent overloading the UI with updates. As with the downloadProgress choke, this is implemented by dropping signals that occur within 100ms of the previous emission. The 100% signal is always emitted (bytesSent == bytesTotal) When the upload size is initially unknown, this behaviour is still provided by the upload device emitting a suitable readProgress signal when EOF is reached. Task-number: QTBUG-20449 Change-Id: I77e03c8a49109106e1c375ee00380293fd326b63 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Make QUnicodeTables::script() support SMP code pointsKonstantin Ritt2012-06-141-3/+31
| | | | | | | | | | | | | | | | | | | Instead of expanding the scripts table with script values for the code points >= 0x10000, it has been merged with the properties table in order to increase perfomance of the script itemization code (not affected yet). (Stats: the properties table grew up in 97428-89800 = 7628 bytes; the old scripts table was of size 7680 bytes) The outdated ScriptsInitial.txt and ScriptsCorrections.txt file has been removed (they were just empty, the "corrigendum" script corrections should be applied to Scripts.txt directly, *no customization allowed*!). More script testcases has been added - at least one per supported script. Task-number: QTBUG-6530 Change-Id: I40a9e76f681e2dd552fd4c61af0808d043962e79 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix namespace compilation on OSX.Toby Tomkins2012-06-141-1/+1
| | | | | Change-Id: Ib579ae298a5f894b8b02a5d56567870109bd29bd Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix QDnsLookup test again after public DNS servers changedThiago Macieira2012-06-141-1/+1
| | | | | | | | | gitorious.org's IP no longer resolves back to gitorious.org. This fix is temporary, again. Change-Id: I85b5fe1c5e603d23dd3226b843ef42165d4c417b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Partial fix for WebKit compilation on WindowsSimon Hausmann2012-06-133-0/+7
| | | | | | | | | | | | | | | | | | | | | | qdatetime.h uses std::min/max and on Windows windows.h (or some subsequent header file) may under certain circumstances define min/max as macros. The easiest way to prevent the windows header files from doing that is to define NOMINMAX in the place right before windows.h is included. The other way is to define min and max to min/max themselves to prevent windows.h from doing its evil thing. If a user of Qt (WebKit in this case) chooses the approach of defining min/max to themselves and then includes qdatetime.h, then a subsequent inclusion of windows.h doesn't work because qdatetime.h undefines min/max. We should not enforce the type of workaround needed, therefore this patch removes the workaround from qdatetime.h and requires user code that happens to include windows header files before qdatetime.h (seldom case) to choose either workaround. Change-Id: I7347eec7369491a065e894cff557004e069453d5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't use gcc extension for QByteArrayLiteral neitherLars Knoll2012-06-121-1/+1
| | | | | | | | | This extension doesn't work for e.g. default arguments in function declarations. Change-Id: I32b7afa6e01b6af55fb2409179b4fd94cb04cd8d Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Now merge the QtShared::ExternalRefCount class into QSharedPointerThiago Macieira2012-06-121-2/+2
| | | | | | | | | Completing the work of the previous commit: we don't need separate classes. Merge into the main class's body. Change-Id: I2f89b34cb6b7f5f9e8d8b809bebd86656f458644 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Remove "delete value" from QSharedPointerThiago Macieira2012-06-125-111/+38
| | | | | | | | | | | | | | | | | | | | | | | | This allows a QSharedPointer to be used in contexts where the class in question is still forward-declared. This produced a warning in Qt 4 due to the expansion of the template, even if there was no chance of the pointer being deleted there (because the reference count could not drop to zero). Now, not only is the warning removed, but you can actually have the reference count drop to zero in a forward-declared class and it will do the right thing. That's because the deleter function is always recorded from the point of construction and we're sure that it wasn't forward-declared. The unit test for forward-declarations had to be rewritten. The previous version was passing only because the QSharedPointer object was created under the "tracking pointers" mode, which causes a custom deleter to be used in all cases. Task-number: QTBUG-25819 Change-Id: Ife37a4cea4551d94084b49ee03504dd39b8802c1 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Fix automatic declaration of QSharedPointer<T> metatypes.Stephen Kelly2012-06-121-4/+27
| | | | | | | | | | | | | | | | | | | | | | | QSharedPointer doesn't work like the other automatic template metatype declarations because in some cases T* is declared as a metatype, but we are interested in QSharedPointer<T> (eg QObject*). In other cases, T is declared as a metatype and we are interested in QSharedPointer<T> (eg char). In particular the macro used before this patch was attempting to get the metatype id of the element_type using for example qMetaTypeId<QObject>() instead of qMetaTypeId<QObject*>(), which did not work. Similarly, the variadic macro driven test is no good, because it was testing QSharedPointer<QObject*> instead of QSharedPointer<QObject>, so that is removed. In the end, the only thing we can sensibly automatically declare as metatypes are QSharedPointers to QObject derived types. That is also the type that makes the most sense in a QML context anyway. Change-Id: I13dd40147e2e6bedf38661f898102abaaaa96208 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Clean up and consolidate QDateTime-related tests.Mitch Curtis2012-06-123-210/+155
| | | | | | | | | | Some test functions that only test QDate and QTime were in tst_qdatetime.cpp. Upon moving these into tst_qdate.cpp and tst_qtime.cpp, there were already some similar tests so I consolidated them. Change-Id: I5f8758bf8b4804ae9d3a482f49d21de9f7a1dc03 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix compilation of tests/auto/corelib/tools with QT_STRICT_ITERATORSThiago Macieira2012-06-122-22/+44
| | | | | | | | | Most fixes are simple and quite obvious. The ones more involved are the ones to QArrayData, which had probably not been compiled with strict iterators thus far. Change-Id: Ic4ff84c34fd9a04fd686fecaa98149b1c47c9346 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Only quit if there are no visible widgets or windows.Stephen Kelly2012-06-122-0/+87
| | | | | | | | | | | | | | We need to let the QGuiApplication determine whether quitting is appropriate based on whether there are visible top level QWindows after the last top-level QWidget was closed. This solves the issue raised here: http://thread.gmane.org/gmane.comp.lib.qt.user/1880 The transientParent is the QWindow equivalent of parentWidget on QWidget, so the test in QGuiApplication::shouldQuit is similar to the one in QApplication::shouldQuit. Change-Id: I500eff8d5887f24415180134b3a4be3c630a896f Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Use a QVector<int> instead of a QSet<int> in itemviews/models.Stephen Kelly2012-06-121-8/+6
| | | | | | | | | | | | | | The QSet<int> is a more expensive container to use and create, so it should be avoided. This is source incompatible compared to earlier Qt 5 for QAbstractItemView subclasses which reimplement dataChanged, but this patch changes nothing compared to already-present SiC compared to Qt 4. Change-Id: Id95391dfd62a0a7f487a8765790b007badefb937 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Avoid a type name normalization during auto-registration.Jędrzej Nowacki2012-06-121-1/+13
| | | | | | | Containers are auto-registered and use normalized names. Change-Id: Id65c3940401f69436929220e1f6a971135e147ed Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add a unit test to QSharedPointer being deleted by a C++11 lambdaThiago Macieira2012-06-121-0/+32
| | | | | | | | | This already worked, but let's have a test so we can be sure it doesn't regress. Change-Id: I358b436d216e3ec4310f05ccf4f70f9e7aad3281 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make qmetaobject autotest independent of QtWidgetsDebao Zhang2012-06-112-9/+9
| | | | | Change-Id: I4340036a4e6024d9b8d0c7832ad7bfb28ec4bc99 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Line Breaking Algorithm: handle the Object Replacement CharacterKonstantin Ritt2012-06-102-3/+1
| | | | | | | | See http://www.unicode.org/reports/tr14/#CB and http://www.unicode.org/reports/tr14/#LB20 for details Change-Id: Ice0aa2b2ce81f6e39839a353240420436eddd754 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Line Breaking Algorithm: don't break inside numeric expressionsKonstantin Ritt2012-06-101-25/+0
| | | | | Change-Id: I8362663454e4c6604ecb6289ae8009d47c78aeb1 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update the Unicode Text Breaking Algorithm implementation testsKonstantin Ritt2012-06-105-669/+7659
| | | | | | | | | | | * The Line Breaking Algorithm implementation conformance tests has been added; * The Grapheme, Word, and Sentence Breaking Algorithm implementation conformance tests has been updated. Change-Id: Ia1a6eef6272d580964cb23788ddf30dfd5f4a5a3 Note: the Line Break test data contains some extended cases we don't currently support; just skip them for now. Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update the Unicode Text Breaking Algorithm implementationKonstantin Ritt2012-06-101-3/+1
| | | | | | | | | | | | | | | | | | to make it conformant to the Unicode 6.1 specifications #14 and #29. The most important changes are: * The implementation has been reworked from scratch to fix all known bugs; * Separate-out the grapheme and the line breaking implementation to eliminate an overhead due to calculating unnecessary breaks; * Stop using deprecated SG class in favor of resolving pairs of surrogates; * A proper support for SMP code points; * Support for extended grapheme clusters (a drop-in replacement for the legacy grapheme clusters as of Unicode 5.1); * The hardcoded tailoring of UBA has been eliminated which breaks the 7 years-old lineBreaking test. Some later, we'll investigate if such a tailoring is still needed. Change-Id: I9f5867b3cec753b4fc120bc5a7e20f9a73d89370 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update the Unicode related autotestsKonstantin Ritt2012-06-103-76/+922
| | | | | | | | | | | Update NormalizationTest.txt data file with one from UCD 6.1; Add few more QChar::unicodeVersion() testcases; Add some line break class mapping testcases; Add some exceptional case mapping testcases; Add script class mapping test; Change-Id: I164394984abb2b893c8db62fb77e7bd87aa0850b Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make qpointer autotest build without widgetsKent Hansen2012-06-102-1/+12
| | | | | | | Change-Id: Ibd05a49174e7055faa89c48659130a11418b9616 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Debao Zhang <dbzhang800@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use UTF-8 in the QtTest data and benchmark tagsThiago Macieira2012-06-0932-32/+32
| | | | | | | | | | | Future-proofing. Since Qt source code is now mandated to be in UTF-8, it is entirely possible that someone will use non-ASCII in data tags. Though it would be interesting to see how to access them from the Windows command-line. Change-Id: I880fc312432b62143888ff1e1d9abbd54f704601 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QZip: improve reading of zip files, fix some edge cases in writingKonstantin Ritt2012-06-081-1/+1
| | | | | | | | | | This supercede https://codereview.qt-project.org/#change,25111 and fixes some more cases; The autotest crash is fixed as well (but the test itself omitted due to .pro file misconfiguration) Change-Id: I4a3adde18b4f9a8ac9822f700eee71d2a12b9c2c Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
* Fix crash in QTreeWidgetItem::sortChildren when adding new item.Markku Heikkila2012-06-081-0/+33
| | | | | | | | | | | | | | | | | | | This is a cherry-pick of 4f388c383e39b598d997e21bd9a4f16d89bd0625 from February Recursive call is caused if user code calls QtreeWidgetItem()::sortChildren and sorting is enbled in QTreeWidget. First call is from user code and second is caused by timer. When timer expires second call is made. This recursion is prevented with QTreeModel::SkipSorting skipSorting() in QTreeWidgetItem::sortChildren(); Task-number: QTBUG-20345 Change-Id: Ibf73e69274423f31397a9e391bfba7d5c4103a3c Reviewed-by: Markku Tapio Heikkilä <markku.heikkila@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Make qfont autotest build without widgetsKent Hansen2012-06-082-4/+11
| | | | | Change-Id: I2ab344d44cb2aa8c59c1c28f7368784849d4b74d Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make qicon autotest build without widgetsKent Hansen2012-06-082-1/+6
| | | | | Change-Id: Ic6176404076bac956d00d57c99e0bbf0ac78beca Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Allow ISODate string without seconds in QTime::fromString().Mitch Curtis2012-06-081-0/+28
| | | | | | | | | According to ISO 8601 (section 4.2.2.3), seconds can be omitted from a string representing time. Task-number: QTBUG-2813 Change-Id: I2578f290845e46a8f49be489f1d7427984ae7f08 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Shift positions for lineBreakTypeKonstantin Ritt2012-06-071-4/+4
| | | | | | | | | | | | | | | | | | | to keep them consistent with positions for all other flags. This changes the internal behavior so that attributes[0].lineBreakType now means "break opportunity at start of the text (before the first character in the string)" and is always assigned with HB_NoBreak to conform rule LB2 (see http://www.unicode.org/reports/tr14/#LB2). The current implementation is based on the sample implementation from tr14 that aimed to be as simple as possible rather than to be optimal. From now, we can use pieces of the attributes array "as is" without having to adjust some positions. Or we can analize some long text by chunks (e.g. paragraph by paragraph) and consume less memory. This introduces a minor overhead that will be eliminated shortly. Change-Id: Ic873a05a9d5203b1c3d5aff2e4445a3f034c4bd2 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QTextBoundaryFinder: Consider soft hyphen as line breaking opportunityKonstantin Ritt2012-06-071-1/+31
| | | | | | | SoftHyphen enum value was added to specify such a boundary reason Change-Id: I4248909eed6ab8cbca419de4dcf9fe917620a158 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make qtexttable autotest build without widgetsKent Hansen2012-06-072-1/+8
| | | | | Change-Id: Id5f93dee0c4b5978c473838559f586ced35a2981 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make sql autotests build without widgetsKent Hansen2012-06-071-0/+2
| | | | | Change-Id: Icd4d2ef39961e2e0ec5c9e910c74b3e8a35503bf Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make "other" autotests build without widgetsKent Hansen2012-06-071-0/+14
| | | | | Change-Id: I49e73c31b98e43259771c0e265cf13fc167c45f2 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>