From e657c31e332571ed9c717764423da378321ee374 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 24 Jan 2024 15:45:47 +0100 Subject: [PATCH] tst_QLocale::dayName(): Convert some dangling code into test rows Every test row was following its locale-specific test with tests for Irish and Greek day names, repeated regardless of the locale-specific data. Express these tests as rows in their own right and shorten the per-row testing, so we only do each once. Change-Id: I8f919b50ac54423bacab6e5a9d34254b7db59a55 Reviewed-by: Thiago Macieira --- .../auto/corelib/text/qlocale/tst_qlocale.cpp | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp index 4dfebb45446..ac86b0c7d3c 100644 --- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp @@ -3082,6 +3082,18 @@ void tst_QLocale::dayName_data() << QString("ru_RU") << QString::fromUtf8("\320\262\321\201") << 7 << QLocale::ShortFormat; QTest::newRow("ru_RU narrow") << QString("ru_RU") << u"\u0412"_s << 7 << QLocale::NarrowFormat; + + QTest::newRow("ga_IE/Mon") << QString("ga_IE") << QString("Luan") << 1 << QLocale::ShortFormat; + QTest::newRow("ga_IE/Sun") << QString("ga_IE") << QString("Domh") << 7 << QLocale::ShortFormat; + QTest::newRow("el_GR/Tue") + << QString("el_GR") << QString::fromUtf8("\316\244\317\201\316\257") + << 2 << QLocale::ShortFormat; + QTest::newRow("el_GR/Thu") + << QString("el_GR") << QString::fromUtf8("\316\240\316\255\316\274") + << 4 << QLocale::ShortFormat; + QTest::newRow("el_GR/Sat") + << QString("el_GR") << QString::fromUtf8("\316\243\316\254\316\262") + << 6 << QLocale::ShortFormat; } void tst_QLocale::dayName() @@ -3093,15 +3105,6 @@ void tst_QLocale::dayName() QLocale l(locale_name); QCOMPARE(l.dayName(day, format), dayName); - - QLocale ir("ga_IE"); - QCOMPARE(ir.dayName(1, QLocale::ShortFormat), QLatin1String("Luan")); - QCOMPARE(ir.dayName(7, QLocale::ShortFormat), QLatin1String("Domh")); - - QLocale gr("el_GR"); - QCOMPARE(gr.dayName(2, QLocale::ShortFormat), QString::fromUtf8("\316\244\317\201\316\257")); - QCOMPARE(gr.dayName(4, QLocale::ShortFormat), QString::fromUtf8("\316\240\316\255\316\274")); - QCOMPARE(gr.dayName(6, QLocale::ShortFormat), QString::fromUtf8("\316\243\316\254\316\262")); } void tst_QLocale::standaloneDayName_data()