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 <thiago.macieira@intel.com>
This commit is contained in:
Edward Welbourne 2024-01-24 15:45:47 +01:00
parent cee1c620d5
commit e657c31e33

View File

@ -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()