[locale] Make sanity checks in tests more explicit

SEE #1490
This commit is contained in:
Adriaan de Groot 2020-08-17 15:09:20 +02:00
parent 14875259c7
commit 24efce0c1d

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> === /* === This file is part of Calamares - <http://github.com/calamares> ===
* *
* Copyright 2019-2020, Adriaan de Groot <groot@kde.org> * SPDX-FileCopyrightText: 2019-2020 Adriaan de Groot <groot@kde.org>
* SPDX-License-Identifier: GPL-3.0-or-later
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -42,6 +43,7 @@ private Q_SLOTS:
void testSplitLocaleConfiguration(); void testSplitLocaleConfiguration();
// Check the TZ images for consistency // Check the TZ images for consistency
void testTZSanity();
void testTZImages(); // No overlaps in images void testTZImages(); // No overlaps in images
void testTZLocations(); // No overlaps in locations void testTZLocations(); // No overlaps in locations
void testSpecificLocations(); void testSpecificLocations();
@ -106,6 +108,18 @@ LocaleTests::testSplitLocaleConfiguration()
QCOMPARE( lc3.lc_numeric, QStringLiteral( "de_DE.UTF-8" ) ); QCOMPARE( lc3.lc_numeric, QStringLiteral( "de_DE.UTF-8" ) );
} }
void
LocaleTests::testTZSanity()
{
// Data source for all TZ info
QVERIFY( QFile( "/usr/share/zoneinfo/zone.tab" ).exists() );
// Contains a sensible number of total zones
const CalamaresUtils::Locale::ZonesModel zones;
QVERIFY( zones.rowCount( QModelIndex() ) > 100 );
}
void void
LocaleTests::testTZImages() LocaleTests::testTZImages()
{ {