2
* Copyright (C) 2011 Andriy Rysin (rysin@kde.org)
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
#include <QtGui/QApplication>
21
#include <qtest_kde.h>
23
#include "../iso_codes.h"
26
class IsoCodesTest : public QObject
34
isoCodes = new IsoCodes(IsoCodes::iso_639);
37
void cleanupTestCase() {
42
QVERIFY( isoCodes != NULL );
43
QVERIFY( ! isoCodes->getEntryList().isEmpty() );
44
const IsoCodeEntry* isoEntry = isoCodes->getEntry(IsoCodes::attr_iso_639_2T_code, "eng");
45
QVERIFY( isoEntry != NULL );
46
QVERIFY( ! isoEntry->empty() );
47
QCOMPARE( isoEntry->value(IsoCodes::attr_iso_639_2T_code), QString("eng") );
48
QCOMPARE( isoEntry->value(IsoCodes::attr_iso_639_2B_code), QString("eng") );
49
QCOMPARE( isoEntry->value(IsoCodes::attr_iso_639_1_code), QString("en") );
52
void loadIsoCodesBenchmark() {
54
IsoCodes* isoCodes = new IsoCodes(IsoCodes::iso_639);
61
//TODO: something lighter than KDEMAIN ?
62
QTEST_KDEMAIN( IsoCodesTest, NoGUI )
64
#include "iso_codes_test.moc"