File indexing completed on 2024-04-14 14:19:43
0001 /* 0002 * This file is part of the KDE libraries. 0003 * Copyright 2009 Michael Leupold <lemma@confuego.org> 0004 * 0005 * This library is free software; you can redistribute it and/or 0006 * modify it under the terms of the GNU Lesser General Public 0007 * License as published by the Free Software Foundation; either 0008 * version 2.1 of the License, or (at your option) version 3, or any 0009 * later version accepted by the membership of KDE e.V. (or its 0010 * successor approved by the membership of KDE e.V.), which shall 0011 * act as a proxy defined in Section 6 of version 3 of the license. 0012 * 0013 * This library is distributed in the hope that it will be useful, 0014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0016 * Lesser General Public License for more details. 0017 * 0018 * You should have received a copy of the GNU Lesser General Public 0019 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 0020 */ 0021 0022 #ifndef KLOCALETIMEFORMATTEST_H 0023 #define KLOCALETIMEFORMATTEST_H 0024 0025 #include <QObject> 0026 #include <QString> 0027 #include <QTime> 0028 #include <QMap> 0029 #include <klocale.h> 0030 0031 struct TimeFormatTestValue { 0032 QString timeFormat; // time format string 0033 // expected values for the various format options 0034 QMap<KLocale::TimeFormatOptions, QString> exp; 0035 }; 0036 0037 class KLocaleTimeFormatTest : public QObject 0038 { 0039 Q_OBJECT 0040 0041 private Q_SLOTS: 0042 void initTestCase(); 0043 0044 void formatTimeTest(); 0045 void readTimeTest(); 0046 0047 void formatAndReadAllCountriesTest(); 0048 0049 private: 0050 QMap<QString, TimeFormatTestValue> m_timeFormats; 0051 QMap<QString, QString> m_allFormats; 0052 }; 0053 0054 #endif 0055