From adf81c0ab55620123319705a18358013b4e06a9a Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 21 Feb 2020 18:24:39 +0100 Subject: [PATCH] [locale][packagechooser] Fix tests, QCOMPARE again --- src/modules/locale/Tests.cpp | 22 +++++++++++----------- src/modules/packagechooser/Tests.cpp | 14 +++++++------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/modules/locale/Tests.cpp b/src/modules/locale/Tests.cpp index b8e471339..83a2d42ff 100644 --- a/src/modules/locale/Tests.cpp +++ b/src/modules/locale/Tests.cpp @@ -48,13 +48,13 @@ LocaleTests::testDefaultLocaleConfiguration() { LocaleConfiguration lc( "en_US.UTF-8" ); QVERIFY( !lc.isEmpty() ); - QCOMPARE( lc.language(), "en_US.UTF-8" ); - QCOMPARE( lc.toBcp47(), "en" ); + QCOMPARE( lc.language(), QStringLiteral( "en_US.UTF-8" ) ); + QCOMPARE( lc.toBcp47(), QStringLiteral( "en" ) ); LocaleConfiguration lc2( "de_DE.UTF-8" ); QVERIFY( !lc2.isEmpty() ); - QCOMPARE( lc2.language(), "de_DE.UTF-8" ); - QCOMPARE( lc2.toBcp47(), "de" ); + QCOMPARE( lc2.language(), QStringLiteral( "de_DE.UTF-8" ) ); + QCOMPARE( lc2.toBcp47(), QStringLiteral( "de" ) ); } void @@ -62,18 +62,18 @@ LocaleTests::testSplitLocaleConfiguration() { LocaleConfiguration lc( "en_US.UTF-8", "de_DE.UTF-8" ); QVERIFY( !lc.isEmpty() ); - QCOMPARE( lc.language(), "en_US.UTF-8" ); - QCOMPARE( lc.toBcp47(), "en" ); + QCOMPARE( lc.language(), QStringLiteral( "en_US.UTF-8" ) ); + QCOMPARE( lc.toBcp47(), QStringLiteral( "en" ) ); QCOMPARE( lc.lc_numeric, QStringLiteral( "de_DE.UTF-8" ) ); LocaleConfiguration lc2( "de_DE.UTF-8", "da_DK.UTF-8" ); QVERIFY( !lc2.isEmpty() ); - QCOMPARE( lc2.language(), "de_DE.UTF-8" ); - QCOMPARE( lc2.toBcp47(), "de" ); - QCOMPARE( lc2.lc_numeric, "da_DK.UTF-8" ); + QCOMPARE( lc2.language(), QStringLiteral( "de_DE.UTF-8" ) ); + QCOMPARE( lc2.toBcp47(), QStringLiteral( "de" ) ); + QCOMPARE( lc2.lc_numeric, QStringLiteral( "da_DK.UTF-8" ) ); LocaleConfiguration lc3( "da_DK.UTF-8", "de_DE.UTF-8" ); QVERIFY( !lc3.isEmpty() ); - QCOMPARE( lc3.toBcp47(), "da" ); - QCOMPARE( lc3.lc_numeric, "de_DE.UTF-8" ); + QCOMPARE( lc3.toBcp47(), QStringLiteral( "da" ) ); + QCOMPARE( lc3.lc_numeric, QStringLiteral( "de_DE.UTF-8" ) ); } diff --git a/src/modules/packagechooser/Tests.cpp b/src/modules/packagechooser/Tests.cpp index 639d06d65..da355dc96 100644 --- a/src/modules/packagechooser/Tests.cpp +++ b/src/modules/packagechooser/Tests.cpp @@ -71,21 +71,21 @@ PackageChooserTests::testAppData() #ifdef HAVE_XML PackageItem p1 = fromAppData( m ); QVERIFY( p1.isValid() ); - QCOMPARE( p1.id, "io.calamares.calamares.desktop" ); - QCOMPARE( p1.name.get(), "Calamares" ); + QCOMPARE( p1.id, QStringLiteral( "io.calamares.calamares.desktop" ) ); + QCOMPARE( p1.name.get(), QStringLiteral( "Calamares" ) ); // The entry has precedence - QCOMPARE( p1.description.get(), "Calamares is an installer program for Linux distributions." ); + QCOMPARE( p1.description.get(), QStringLiteral( "Calamares is an installer program for Linux distributions." ) ); // .. but en_GB doesn't have an entry in description, so uses - QCOMPARE( p1.description.get( QLocale( "en_GB" ) ), "Calamares Linux Installer" ); - QCOMPARE( p1.description.get( QLocale( "nl" ) ), "Calamares is een installatieprogramma voor Linux distributies." ); + QCOMPARE( p1.description.get( QLocale( "en_GB" ) ), QStringLiteral( "Calamares Linux Installer" ) ); + QCOMPARE( p1.description.get( QLocale( "nl" ) ), QStringLiteral( "Calamares is een installatieprogramma voor Linux distributies." ) ); QVERIFY( p1.screenshot.isNull() ); m.insert( "id", "calamares" ); m.insert( "screenshot", ":/images/calamares.png" ); PackageItem p2 = fromAppData( m ); QVERIFY( p2.isValid() ); - QCOMPARE( p2.id, "calamares" ); - QCOMPARE( p2.description.get( QLocale( "nl" ) ), "Calamares is een installatieprogramma voor Linux distributies." ); + QCOMPARE( p2.id, QStringLiteral( "calamares" ) ); + QCOMPARE( p2.description.get( QLocale( "nl" ) ), QStringLiteral( "Calamares is een installatieprogramma voor Linux distributies." ) ); QVERIFY( !p2.screenshot.isNull() ); #endif }