aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllocale
Commit message (Collapse)AuthorAgeFilesLines
* tst_qqmllocale: avoid duplicating a QLocale::toString() callEdward Welbourne2017-01-101-6/+9
| | | | | | | | Reuse the same const QString in both places, in each of the functions that repeated this pattern. Change-Id: Ic20281692d84b3ad5257af9837957e0893452b1a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* tst_qqmllocale: simplify creation of a QDateTimeEdward Welbourne2017-01-101-27/+9
| | | | | | | | | Nine tests all used setDate and setTime on a default QDateTime, where just initializing it right, in one line, is simple, terse and easy to understand. This also allows it to be const. Change-Id: I77fd8b36b705cafc49f9020ae9280dfdcfece0d8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* tst_qqmllocale: shuffle commentary on JS Date's month numberingEdward Welbourne2017-01-102-6/+7
| | | | | | | | | | | | While it departs from common date numbering, as used by QDateTime, the 0=Jan numbering used by JS's Date was copied from Java's Date, which (probably) copied it from ANSI C's struct tm; and C likes to count from zero. So don't call it weird; and let's comment on it where it's actually relevant (in JS code with the offset, rather than against uses of QDate, which uses 1=Jan numbering) and only once. Change-Id: I926138e88583339bec8641e3b28a642794dc217d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* tst_qqmllocale: use unsetenv to clear environment variableEdward Welbourne2017-01-101-1/+4
| | | | | | | | | | | | | | tst_qqmllocale::timeZoneUpdated() was recording the prior time zone, frobbing it for the duration of its test, then restoring it. However, if TZ was previously unset, it got set to empty instead of being unset. This did not quite have the same effect; UTC ends up being used instead of the system default, with potential for conflict between system functions (that have attended to tzset) and third-party libraries (e.g. ICU) with internal state saved from before the change. Change-Id: I9f2147cd8858316e9ba5fd84d95dfc2c4538b0ab Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* tst_qqmllocale: use QVERIFY() rather than QCOMPARE(, true)Edward Welbourne2017-01-101-2/+2
| | | | | | | Use booleans as booleans, it's what they're for. Change-Id: I68c0ba5efcfd3556eeef043b179769e91c77cf03 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Updated license headersJani Heikkinen2016-01-201-17/+12
| | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-10-141-3/+3
|\ | | | | | | Change-Id: I11ea57222ba5aa683b7bfd7735fbc1d2cf86e875
| * Tests: Fix single-character string literals.Friedemann Kleint2015-10-131-3/+3
| | | | | | | | | | | | | | | | Use character literals where applicable. Change-Id: Ib0e618752fbc762a73a0a91c43efab61ef2c9687 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove CONFIG += parallel_test.Friedemann Kleint2015-09-051-1/+0
| | | | | | | | | | | | | | The keyword no longer has a meaning for the new CI. Change-Id: I699f2881e291cce02a6a608a8710638886e38daa Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.Friedemann Kleint2015-09-031-1/+0
|/ | | | | Change-Id: I691b8ddff60b5f16f06d32b379c76e87f44f84a9 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* tests/qml: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).Friedemann Kleint2015-07-291-5/+5
| | | | | | | | | | | | - Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. Change-Id: I8cc97fd9b48fc789a849e9527c292c4e05accd97 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-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. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Fix mapping of JS objects/arrays to C++Simon Hausmann2014-09-171-2/+2
| | | | | | | | | | | | | | | [ChangeLog][QtQml][Important Behavior Changes] When a JavaScript object/array is passed to C++ through a QVariant, the engine no longer immediately converts the object recursively into a QVariantMap or QVariantList but instead stores a QJSValue in the QVariant. This prevents a loss of data when the JS object contains non-primitive types such as function objects for example. Code that expects the variant type to be exactly QVariant::Map or QVariant::List may need to be adapted. Registered conversion functions however ensure that code that merely calls toMap() or toList() continues to work. Task-number: QTBUG-40431 Change-Id: I1dbc1d5f8e78ad28bb62db3681b9a0b34557e7f5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Fix remaining QQmlLocale auto-test failuresSimon Hausmann2014-04-081-3/+0
| | | | | | | | | | | | | | | | Thanks to improvements in QDateTime's parser, we can unskip a bunch of tests. What remained was dateFromLocaleTimeString, which failed because it relied on the earlier behavior of a failed conversion from a _time_ string to a date also returning an invalid date object. This behavior is restored by leaving the QDateTime object as invalid unless the converted time is valid. In Qt <= 5.1, QDateTime::setTime would make the entire datetime object invalid if the provided time was invalid. In Qt >= 5.2 it remains potentially valid if the date at least is correct - which was the case here as it was initialized from currentDateTime. Change-Id: I32a2cd2a9631cca3b12773e4c55169baa3eeaf1a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Allow assignment of a QML Locale object to a C++ QLocale property.Mitch Curtis2014-01-141-0/+36
| | | | | | | Task-number: QTBUG-36125 Change-Id: I58454db0c47684aed3e95c52a8135fd5fd6bf2f9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix qqmllocale testAlan Alpert2013-10-301-5/+1
| | | | | | | | | | Test was only passing the time to the format function, thinking it was the only part under test, but the date is also relevant due to DST being part of the formatted output. Task-number: QTBUG-34406 Change-Id: I1f542b58907281632ee3c96b9b5b38426936953e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Disable DST related locale test temporarilySimon Hausmann2013-10-291-0/+4
| | | | | | | | We prioritize getting other fixes into QtQml right now, so skip these tests. According bug is filed. Change-Id: I9b824e41d2164906b22282e75aa80a69a4ce5652 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix qqmllocale test to use correct spec and time zoneJohn Layt2013-09-051-6/+6
| | | | | | | | | | | | | | | | | By including the +10:00 offset in the date strings the test is actually creating Qt::OffsetFromUTC datetimes, not QT::LocalTime datetimes. The only reason the test currently passes is due to a bug in the QLocale datetime formatter which uses the current system daylight time abbreviation in all cases regardless of the datetime spec or if daylight or standard time. Change 61774 fixes this bug but cannot be merged as this test now fails. This change fixes the bug by removing the offset, causing Qt:LocalTime datetimes to be created which pass the test both before and after change 61774. See https://codereview.qt-project.org/#change,61774 Change-Id: I1642ab7c8aa516b703216f3791e2fc60866d1895 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Skip some tests that are failing because of our date time parserLars Knoll2013-06-211-16/+19
| | | | | | | | The parser needs to be fixed to better parse localized dates, times and timezone fields Change-Id: I6542ee459e7135b6f845fb5fc89685cb8c2d67c5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Wrap tst_qqmllocale::timeZoneUpdated() within Q_OS_UNIX to remove QSKIPJ-P Nurmi2012-09-071-19/+20
| | | | | | Change-Id: I9cb0da7dbca6401069f572aef15d5375aadce30d Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Caroline Chao <caroline.chao@nokia.com>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-011-0/+1
| | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I6988c2360e9d88916311374a0c910bfc5b607439 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add gui-private to testsGirish Ramakrishnan2012-06-221-1/+1
| | | | | | | QWindowSystemInterface will be marked as QPA API. Change-Id: Id174a24f8432219adf1425efe1eb59cf67d48bb9 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fix locale test on Linux and skip it on Windows.Glenn Watson2012-06-222-7/+38
| | | | | | | | | | | The timezone that V8 internally uses was not being updated at the end of one test, causing failures in subsequent tests. This was only showing up on Windows because the test was being skipped on Linux due to a typo. Skip the test on Windows due to complexity of changing the timezone (added comments in code with details). Change-Id: I47c8542111e8ddfbdeff39815c50d98570b0c6c2 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Allow the global JS UTC offset to be invalidatedMatthew Vogt2012-06-052-0/+92
| | | | | | | | | | | If the system timezone is changed, it is necessary to inform V8 so that the global offset-from-UTC value can be recalculated. This changes adds the 'timeZoneUpdated' function to the JS 'Date' class exported by QML, which allows QML applications to inform V8 when the timezone has been updated. Change-Id: Ic5898ca7bc640002a4a6fd5a52b8623d87ee8085 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Mark all Latin 1 strings with QString::fromLatin1 or QLatin1StringThiago Macieira2012-04-241-8/+8
| | | | | | | | | This is in preparation of QString's constructor using UTF-8 by default Change-Id: Ibd0a585342af572e3f74636deb97c1b6b3afeb9a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Changed qml tests to work from install directoryKurt Korbatits2012-03-071-3/+1
| | | | | | | | | | - Changed tests to use TESTDATA - moved qqmlcontext to private test as it contains private header - added check for cross_compile option to skip when sources not available Change-Id: I0f68f58ffcb1b41b8e40a9851e3e003fe72ee2f9 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Merge master <-> api_changesMatthew Vogt2012-03-051-1/+37
| | | | Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-247-0/+1372
Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>