diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-04-11 08:48:27 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-04-11 09:12:36 +0200 |
commit | f34e73a16a3d757057e007874cb5008f16e20f02 (patch) | |
tree | bcc228617cf240773fd09daac1a1a2614b552b68 /tests/auto/corelib/tools | |
parent | 5380808453728a354ae28aae76e85ac448245cf1 (diff) | |
parent | b9d386f2ccd69c7f6a766a6d90a6024eeb48e90a (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
src/corelib/kernel/qobject.cpp
src/gui/painting/qpaintengine_raster.cpp
Change-Id: I74e1779832f43d033708dcfd6b666c7b4f0111fb
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r-- | tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 19 | ||||
-rw-r--r-- | tests/auto/corelib/tools/qstringref/tst_qstringref.cpp | 33 |
2 files changed, 46 insertions, 6 deletions
diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index 80f354671a..8c9dc16ce7 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -1923,8 +1923,8 @@ void tst_QLocale::standaloneDayName_data() QTest::newRow("C short") << QString("C") << QString("Sun") << 7 << QLocale::ShortFormat; QTest::newRow("C narrow") << QString("C") << QString("S") << 7 << QLocale::NarrowFormat; - QTest::newRow("ru_RU long") << QString("ru_RU") << QString::fromUtf8("\320\222\320\276\321\201\320\272\321\200\320\265\321\201\320\265\320\275\321\214\320\265") << 7 << QLocale::LongFormat; - QTest::newRow("ru_RU short") << QString("ru_RU") << QString::fromUtf8("\320\222\321\201") << 7 << QLocale::ShortFormat; + QTest::newRow("ru_RU long") << QString("ru_RU") << QString::fromUtf8("\320\262\320\276\321\201\320\272\321\200\320\265\321\201\320\265\320\275\321\214\320\265") << 7 << QLocale::LongFormat; + QTest::newRow("ru_RU short") << QString("ru_RU") << QString::fromUtf8("\320\262\321\201") << 7 << QLocale::ShortFormat; QTest::newRow("ru_RU narrow") << QString("ru_RU") << QString::fromUtf8("\320\222") << 7 << QLocale::NarrowFormat; } @@ -2183,10 +2183,10 @@ void tst_QLocale::currency() QCOMPARE(en_US.toCurrencyString(double(-1234.56), NULL, 4), QString("$-1,234.5600")); const QLocale ru_RU("ru_RU"); - QCOMPARE(ru_RU.toCurrencyString(qulonglong(1234)), QString::fromUtf8("1" "\xc2\xa0" "234\xc2\xa0\xd1\x80\xd1\x83\xd0\xb1.")); - QCOMPARE(ru_RU.toCurrencyString(qlonglong(-1234)), QString::fromUtf8("-1" "\xc2\xa0" "234\xc2\xa0\xd1\x80\xd1\x83\xd0\xb1.")); - QCOMPARE(ru_RU.toCurrencyString(double(1234.56)), QString::fromUtf8("1" "\xc2\xa0" "234,56\xc2\xa0\xd1\x80\xd1\x83\xd0\xb1.")); - QCOMPARE(ru_RU.toCurrencyString(double(-1234.56)), QString::fromUtf8("-1" "\xc2\xa0" "234,56\xc2\xa0\xd1\x80\xd1\x83\xd0\xb1.")); + QCOMPARE(ru_RU.toCurrencyString(qulonglong(1234)), QString::fromUtf8("1" "\xc2\xa0" "234\xc2\xa0\xe2\x82\xbd")); + QCOMPARE(ru_RU.toCurrencyString(qlonglong(-1234)), QString::fromUtf8("-1" "\xc2\xa0" "234\xc2\xa0\xe2\x82\xbd")); + QCOMPARE(ru_RU.toCurrencyString(double(1234.56)), QString::fromUtf8("1" "\xc2\xa0" "234,56\xc2\xa0\xe2\x82\xbd")); + QCOMPARE(ru_RU.toCurrencyString(double(-1234.56)), QString::fromUtf8("-1" "\xc2\xa0" "234,56\xc2\xa0\xe2\x82\xbd")); const QLocale de_DE("de_DE"); QCOMPARE(de_DE.toCurrencyString(qulonglong(1234)), QString::fromUtf8("1.234\xc2\xa0\xe2\x82\xac")); @@ -2346,14 +2346,20 @@ void tst_QLocale::textDirection_data() case QLocale::CentralKurdish: case QLocale::ClassicalMandaic: case QLocale::Divehi: +// case QLocale::Fulah: +// case QLocale::Hausa: case QLocale::Hebrew: +// case QLocale::Hungarian: case QLocale::Kashmiri: +// case QLocale::Kurdish: case QLocale::Lydian: case QLocale::Mandingo: case QLocale::ManichaeanMiddlePersian: + case QLocale::Mazanderani: case QLocale::Mende: case QLocale::Meroitic: case QLocale::Nko: + case QLocale::NorthernLuri: case QLocale::OldTurkish: case QLocale::Pahlavi: case QLocale::Parthian: @@ -2367,6 +2373,7 @@ void tst_QLocale::textDirection_data() case QLocale::Syriac: case QLocale::Uighur: case QLocale::Urdu: + case QLocale::Yiddish: rightToLeft = QLocale(QLocale::Language(language)).language() == QLocale::Language(language); // false if there is no locale data for language break; default: diff --git a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp index b98c2fb4de..25b97ceaa8 100644 --- a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp +++ b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp @@ -52,6 +52,7 @@ private slots: void indexOf(); void indexOf2_data(); void indexOf2(); + void iteration(); void length_data(); void length(); void isEmpty(); @@ -446,6 +447,38 @@ void tst_QStringRef::indexOf2() } } +void tst_QStringRef::iteration() +{ + QString hello = "Hello"; + QString olleh = "olleH"; + + QStringRef ref(&hello); + QStringRef rref(&olleh); + + const QStringRef &cref = ref; + const QStringRef &crref = rref; + + QVERIFY(std::equal( ref.begin(), ref.end(), hello.begin())); + QVERIFY(std::equal( rref.begin(), rref.end(), olleh.begin())); + QVERIFY(std::equal( cref.begin(), cref.end(), hello.begin())); + QVERIFY(std::equal(crref.begin(), crref.end(), olleh.begin())); + + QVERIFY(std::equal( ref.cbegin(), ref.cend(), hello.begin())); + QVERIFY(std::equal( rref.cbegin(), rref.cend(), olleh.begin())); + QVERIFY(std::equal( cref.cbegin(), cref.cend(), hello.begin())); + QVERIFY(std::equal(crref.cbegin(), crref.cend(), olleh.begin())); + + QVERIFY(std::equal( ref.rbegin(), ref.rend(), hello.rbegin())); + QVERIFY(std::equal( rref.rbegin(), rref.rend(), olleh.rbegin())); + QVERIFY(std::equal( cref.rbegin(), cref.rend(), hello.rbegin())); + QVERIFY(std::equal(crref.rbegin(), crref.rend(), olleh.rbegin())); + + QVERIFY(std::equal( ref.crbegin(), ref.crend(), hello.rbegin())); + QVERIFY(std::equal( rref.crbegin(), rref.crend(), olleh.rbegin())); + QVERIFY(std::equal( cref.crbegin(), cref.crend(), hello.rbegin())); + QVERIFY(std::equal(crref.crbegin(), crref.crend(), olleh.rbegin())); +} + void tst_QStringRef::lastIndexOf_data() { QTest::addColumn<QString>("haystack"); |