diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-12-08 01:00:59 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-12-08 01:01:00 +0100 |
commit | f8c5c1356465f503e1a8357ceff01bb956d51c9e (patch) | |
tree | 36b5bc1c2d5767b3eee0820c70b91fdfc57287b3 /tests/auto/corelib | |
parent | eda28621f6c1a68774719f382be53ec109123b18 (diff) | |
parent | 153726bc167406414f589f72bea76c3229cfa815 (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Ied1194730e75a6f30839bbf5429aa2699230288e
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r-- | tests/auto/corelib/io/qsettings/qsettings.qrc | 1 | ||||
-rw-r--r-- | tests/auto/corelib/io/qsettings/tst_qsettings.cpp | 29 | ||||
-rw-r--r-- | tests/auto/corelib/io/qsettings/withcomments.ini | 19 | ||||
-rw-r--r-- | tests/auto/corelib/tools/qcollator/tst_qcollator.cpp | 7 |
4 files changed, 50 insertions, 6 deletions
diff --git a/tests/auto/corelib/io/qsettings/qsettings.qrc b/tests/auto/corelib/io/qsettings/qsettings.qrc index c664a6f68c..db1d8c663f 100644 --- a/tests/auto/corelib/io/qsettings/qsettings.qrc +++ b/tests/auto/corelib/io/qsettings/qsettings.qrc @@ -7,5 +7,6 @@ <file>resourcefile5.ini</file> <file>resourcefile6.plist</file> <file>bom.ini</file> + <file>withcomments.ini</file> </qresource> </RCC> diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index 5357194406..8b69518ef7 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -187,6 +187,7 @@ private slots: void bom(); void embeddedZeroByte_data(); void embeddedZeroByte(); + void spaceAfterComment(); void testXdg(); private: @@ -764,6 +765,34 @@ void tst_QSettings::embeddedZeroByte() } } +void tst_QSettings::spaceAfterComment() +{ + QSettings settings(QFINDTESTDATA("withcomments.ini"), QSettings::IniFormat); + QCOMPARE(settings.status(), QSettings::NoError); + + QStringList groups = settings.childGroups(); + QVERIFY(groups.contains("Regular")); + QVERIFY(groups.contains("WithSpaces")); + QVERIFY(groups.contains("WithTab")); + QVERIFY(groups.contains("SpacedGroup")); + + settings.beginGroup("Regular"); + QCOMPARE(settings.value("bar"), QVariant(2)); + settings.endGroup(); + + settings.beginGroup("WithSpaces"); + QCOMPARE(settings.value("bar"), QVariant(4)); + settings.endGroup(); + + settings.beginGroup("WithTab"); + QCOMPARE(settings.value("bar"), QVariant(6)); + settings.endGroup(); + + settings.beginGroup("SpacedGroup"); + QCOMPARE(settings.value("bar"), QVariant(7)); + settings.endGroup(); +} + void tst_QSettings::testErrorHandling_data() { QTest::addColumn<int>("filePerms"); // -1 means file should not exist diff --git a/tests/auto/corelib/io/qsettings/withcomments.ini b/tests/auto/corelib/io/qsettings/withcomments.ini new file mode 100644 index 0000000000..d2de3a356b --- /dev/null +++ b/tests/auto/corelib/io/qsettings/withcomments.ini @@ -0,0 +1,19 @@ +; -*- conf -*- +; If you edit this file, make sure, that "WithSpaces" has spaces and that +; "WithTab" has one tab + +[Regular] +;bar = 1 +bar = 2 + +[WithSpaces] +;bar = 3 + bar = 4 + +[WithTab] +;bar = 5 + bar = 6 + +; [SpacedGroup] + [SpacedGroup] + bar = 7 diff --git a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp index 00b22dab6c..2d65d3433f 100644 --- a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp +++ b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp @@ -96,11 +96,6 @@ void tst_QCollator::compare_data() QTest::addColumn<int>("punctuationResult"); /* - A few tests below are commented out on the mac. It's unclear why they fail, - as it looks like the collator for the locale is created correctly. - */ - - /* It's hard to test English, because it's treated differently on different platforms. For example, on Linux, it uses the iso14651_t1 template file, which happens to provide good @@ -164,7 +159,7 @@ void tst_QCollator::compare_data() QTest::newRow("german13") << QString("de_DE") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; /* - French sorting of e and e with accent + French sorting of e and e with acute accent */ QTest::newRow("french1") << QString("fr_FR") << QString::fromLatin1("\xe9") << QString::fromLatin1("e") << 1 << 1 << false << false << 1; QTest::newRow("french2") << QString("fr_FR") << QString::fromLatin1("\xe9t") << QString::fromLatin1("et") << 1 << 1 << false << false << 1; |