From 02b3d43fd4661271e6e8dc8940d84cb2ba352fe0 Mon Sep 17 00:00:00 2001 From: Luca Beldi Date: Wed, 22 Aug 2018 08:21:01 +0100 Subject: _q_interpolate is unsafe with unsigned template arguments _q_interpolate subtracts 2 arguments of type T, for unsigned types this can cause wrapping around Task-number: QTBUG-57925 Change-Id: Iffa59f413579a3d5de8cb728fe71443d8e8a04aa Reviewed-by: Giuseppe D'Angelo --- .../qvariantanimation/tst_qvariantanimation.cpp | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp b/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp index 00962afa72..ac20fb35ec 100644 --- a/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp +++ b/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp @@ -43,6 +43,7 @@ private slots: void keyValueAt(); void keyValues(); void duration(); + void interpolation(); }; class TestableQVariantAnimation : public QVariantAnimation @@ -129,6 +130,30 @@ void tst_QVariantAnimation::duration() QCOMPARE(anim.duration(), 500); } +void tst_QVariantAnimation::interpolation() +{ + QVariantAnimation unsignedAnim; + unsignedAnim.setStartValue(100u); + unsignedAnim.setEndValue(0u); + unsignedAnim.setDuration(100); + unsignedAnim.setCurrentTime(50); + QCOMPARE(unsignedAnim.currentValue().toUInt(), 50u); + + QVariantAnimation signedAnim; + signedAnim.setStartValue(100); + signedAnim.setEndValue(0); + signedAnim.setDuration(100); + signedAnim.setCurrentTime(50); + QCOMPARE(signedAnim.currentValue().toInt(), 50); + + QVariantAnimation pointAnim; + pointAnim.setStartValue(QPoint(100, 100)); + pointAnim.setEndValue(QPoint(0, 0)); + pointAnim.setDuration(100); + pointAnim.setCurrentTime(50); + QCOMPARE(pointAnim.currentValue().toPoint(), QPoint(50, 50)); +} + QTEST_MAIN(tst_QVariantAnimation) #include "tst_qvariantanimation.moc" -- cgit v1.2.3 From dc7e775c9c6ecc66f76af8139b8dfc3ee101c7ff Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 22 Aug 2018 20:30:57 +0200 Subject: Test for fractional part of Costa Rican currency CLDR up to somewhere between v29 (used by 5.9) and v31.0.1 (used by 5.10 and later) claimed Costa Ricans don't include fractions in their currency; now it claims they expec two digits. Apparently one of them does expect those digits, so this is the regression test I'll be cherry-picking back to LTS, to accompany the CLDR updates they need. Task-number: QTBUG-70093 Change-Id: I138772cc6013fa74de4f7c54b836cac83421eab2 Reviewed-by: Thiago Macieira --- tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index 4131c44c84..b7cb8a1bdc 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -2385,6 +2385,10 @@ void tst_QLocale::currency() QCOMPARE(de_DE.toCurrencyString(double(-1234.56)), QString::fromUtf8("-1.234,56\xc2\xa0\xe2\x82\xac")); QCOMPARE(de_DE.toCurrencyString(double(-1234.56), QLatin1String("BAZ")), QString::fromUtf8("-1.234,56\xc2\xa0" "BAZ")); + const QLocale es_CR(QLocale::Spanish, QLocale::CostaRica); + QCOMPARE(es_CR.toCurrencyString(double(1565.25)), + QString::fromUtf8("\xE2\x82\xA1" "1\xC2\xA0" "565,25")); + const QLocale system = QLocale::system(); QVERIFY(system.toCurrencyString(1, QLatin1String("FOO")).contains(QLatin1String("FOO"))); } -- cgit v1.2.3 From bd42e2f0cebb2fe8de77a054e9d30aa803749a61 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 24 Aug 2018 17:03:03 +0200 Subject: Blacklist two tests on macOS that a planned CI change shall break MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have #if-ery on Q_OS_DARWIN controlling an expectation of gettign "GMT+1" and "GMT+2" instead of "CET" and "CEST" in two tests; this turns out to not be a deficiency of macOS so much as of how we configure Coin's VMs. While we fix that, we need to ignore failures in these tests, so that we can pull the #if-ery out and clear the blacklist once the VMs are set up properly. Task-number: QTBUG-70149 Change-Id: If3577200cf980b3329161ab3eea7bd2e9d0124e0 Reviewed-by: Tony Sarajärvi --- tests/auto/corelib/tools/qdatetime/BLACKLIST | 2 ++ tests/auto/corelib/tools/qlocale/BLACKLIST | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 tests/auto/corelib/tools/qdatetime/BLACKLIST create mode 100644 tests/auto/corelib/tools/qlocale/BLACKLIST (limited to 'tests') diff --git a/tests/auto/corelib/tools/qdatetime/BLACKLIST b/tests/auto/corelib/tools/qdatetime/BLACKLIST new file mode 100644 index 0000000000..3a42ee066b --- /dev/null +++ b/tests/auto/corelib/tools/qdatetime/BLACKLIST @@ -0,0 +1,2 @@ +[timeZoneAbbreviation] +osx diff --git a/tests/auto/corelib/tools/qlocale/BLACKLIST b/tests/auto/corelib/tools/qlocale/BLACKLIST new file mode 100644 index 0000000000..3eac7c10ed --- /dev/null +++ b/tests/auto/corelib/tools/qlocale/BLACKLIST @@ -0,0 +1,2 @@ +[formatTimeZone] +osx -- cgit v1.2.3