Changeset View
Changeset View
Standalone View
Standalone View
src/isotocountrymap_p.h
- This file was copied from autotests/addresstest.h.
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | This file is part of the KContacts framework. | 2 | This file is part of the KContacts framework. | ||
3 | Copyright (c) 2007 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2018 Volker Krause <vkrause@kde.org> | ||
4 | 4 | | |||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or | ||
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public | ||
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either | ||
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. | ||
9 | 9 | | |||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Library General Public License for more details. | 13 | Library General Public License for more details. | ||
14 | 14 | | |||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License | ||
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to | ||
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | 18 | Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef ADDRESS_TEST_H | 21 | #ifndef KCONTACTS_ISOTOCOUNTRYMAP_P_H | ||
22 | #define ADDRESS_TEST_H | 22 | #define KCONTACTS_ISOTOCOUNTRYMAP_P_H | ||
23 | 23 | | |||
24 | #include <QObject> | 24 | #include <QString> | ||
25 | 25 | | |||
26 | class AddressTest : public QObject | 26 | namespace KContacts { | ||
27 | | ||||
28 | /* ISO code to country name string table lookup table entry. */ | ||||
29 | struct IsoToCountryIndex | ||||
30 | { | ||||
31 | explicit constexpr inline IsoToCountryIndex(const char isoCode[2], int offset) | ||||
32 | : m_c1(isoCode[0]) | ||||
33 | , m_c2(isoCode[1]) | ||||
34 | , m_offset(offset) | ||||
27 | { | 35 | { | ||
28 | Q_OBJECT | 36 | } | ||
29 | 37 | | |||
30 | private Q_SLOTS: | 38 | char m_c1; | ||
31 | void initTestCase(); | 39 | char m_c2; | ||
32 | void emptyTest(); | 40 | uint16_t m_offset; | ||
33 | void storeTest(); | | |||
34 | void equalsTest(); | | |||
35 | void differsTest(); | | |||
36 | void assignmentTest(); | | |||
37 | void serializeTest(); | | |||
38 | void formatTest(); | | |||
39 | void shouldExportVcard4(); | | |||
40 | void shouldExportVcard3(); | | |||
41 | void shouldParseAddressVCard3(); | | |||
42 | void shouldParseAddressVCard4(); | | |||
43 | void shouldExportVCard4WithGeoPosition(); | | |||
44 | void shouldParseAddressVCard4WithGeoPosition(); | | |||
45 | void countryToISOTest(); | | |||
46 | }; | 41 | }; | ||
47 | 42 | | |||
43 | } | ||||
44 | | ||||
48 | #endif | 45 | #endif |