From b27bc11975339915b60e973b8081bdbf7cc7feac Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 4 Aug 2020 12:59:55 +0200 Subject: [PATCH] [libcalamares] Merge locale tests files - No need for a separate .h in most test cases --- src/libcalamares/locale/Tests.cpp | 35 +++++++++++++++++----- src/libcalamares/locale/Tests.h | 49 ------------------------------- 2 files changed, 28 insertions(+), 56 deletions(-) delete mode 100644 src/libcalamares/locale/Tests.h diff --git a/src/libcalamares/locale/Tests.cpp b/src/libcalamares/locale/Tests.cpp index 6c5a508d7..3ee3dfdd3 100644 --- a/src/libcalamares/locale/Tests.cpp +++ b/src/libcalamares/locale/Tests.cpp @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === - * + * * SPDX-FileCopyrightText: 2019 Adriaan de Groot + * SPDX-License-Identifier: GPL-3.0-or-later * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,13 +16,8 @@ * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . * - * SPDX-License-Identifier: GPL-3.0-or-later - * License-Filename: LICENSE - * */ -#include "Tests.h" - #include "locale/LabelModel.h" #include "locale/TimeZone.h" #include "locale/TranslatableConfiguration.h" @@ -31,7 +27,26 @@ #include -QTEST_GUILESS_MAIN( LocaleTests ) +class LocaleTests : public QObject +{ + Q_OBJECT +public: + LocaleTests(); + ~LocaleTests() override; + +private Q_SLOTS: + void initTestCase(); + + void testLanguageModelCount(); + void testEsperanto(); + void testTranslatableLanguages(); + void testTranslatableConfig1(); + void testTranslatableConfig2(); + + // TimeZone testing + void testSimpleZones(); + void testComplexZones(); +}; LocaleTests::LocaleTests() {} @@ -257,3 +272,9 @@ LocaleTests::testComplexZones() QCOMPARE( r.tr(), QStringLiteral( "zxc,;* vm" ) ); // Only _ is special } } + +QTEST_GUILESS_MAIN( LocaleTests ) + +#include "utils/moc-warnings.h" + +#include "Tests.moc" diff --git a/src/libcalamares/locale/Tests.h b/src/libcalamares/locale/Tests.h deleted file mode 100644 index dfe85a865..000000000 --- a/src/libcalamares/locale/Tests.h +++ /dev/null @@ -1,49 +0,0 @@ -/* === This file is part of Calamares - === - * - * SPDX-FileCopyrightText: 2019 Adriaan de Groot - * - * Calamares is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Calamares is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Calamares. If not, see . - * - * SPDX-License-Identifier: GPL-3.0-or-later - * License-Filename: LICENSE - * - */ - -#ifndef LIBCALAMARES_LOCALE_TESTS_H -#define LIBCALAMARES_LOCALE_TESTS_H - -#include - -class LocaleTests : public QObject -{ - Q_OBJECT -public: - LocaleTests(); - ~LocaleTests() override; - -private Q_SLOTS: - void initTestCase(); - - void testLanguageModelCount(); - void testEsperanto(); - void testTranslatableLanguages(); - void testTranslatableConfig1(); - void testTranslatableConfig2(); - - // TimeZone testing - void testSimpleZones(); - void testComplexZones(); -}; - -#endif