Changeset View
Changeset View
Standalone View
Standalone View
autotests/jsonlddocumenttest.cpp
Show All 12 Lines | 1 | /* | |||
---|---|---|---|---|---|
13 | 13 | | |||
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License | ||
15 | along with this library; see the file COPYING.LIB. If not, write to the | 15 | along with this library; see the file COPYING.LIB. If not, write to the | ||
16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
17 | 02110-1301, USA. | 17 | 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include <KItinerary/Flight> | 20 | #include <KItinerary/Flight> | ||
21 | #include <KItinerary/Init> | ||||
21 | #include <KItinerary/JsonLdDocument> | 22 | #include <KItinerary/JsonLdDocument> | ||
22 | #include <KItinerary/Organization> | 23 | #include <KItinerary/Organization> | ||
23 | #include <KItinerary/Place> | 24 | #include <KItinerary/Place> | ||
24 | #include <KItinerary/Reservation> | 25 | #include <KItinerary/Reservation> | ||
25 | 26 | | |||
26 | #include <QDebug> | 27 | #include <QDebug> | ||
27 | #include <QJsonArray> | 28 | #include <QJsonArray> | ||
28 | #include <QJsonDocument> | 29 | #include <QJsonDocument> | ||
29 | #include <QJsonObject> | 30 | #include <QJsonObject> | ||
30 | #include <QObject> | 31 | #include <QObject> | ||
31 | #include <QTest> | 32 | #include <QTest> | ||
32 | #include <QTimeZone> | 33 | #include <QTimeZone> | ||
33 | 34 | | |||
34 | using namespace KItinerary; | 35 | using namespace KItinerary; | ||
35 | 36 | | |||
36 | class JsonLdDocumentTest : public QObject | 37 | class JsonLdDocumentTest : public QObject | ||
37 | { | 38 | { | ||
38 | Q_OBJECT | 39 | Q_OBJECT | ||
39 | private Q_SLOTS: | 40 | private Q_SLOTS: | ||
40 | void initTestCase() | 41 | void initTestCase() | ||
41 | { | 42 | { | ||
42 | qputenv("TZ", "GMT"); | 43 | qputenv("TZ", "GMT"); | ||
44 | KItinerary::init(); | ||||
43 | } | 45 | } | ||
44 | 46 | | |||
45 | void testSerialization() | 47 | void testSerialization() | ||
46 | { | 48 | { | ||
47 | Flight f; | 49 | Flight f; | ||
48 | f.setFlightNumber(QLatin1String("1234")); | 50 | f.setFlightNumber(QLatin1String("1234")); | ||
49 | f.setDepartureTime(QDateTime(QDate(2018, 3, 18), QTime(18, 44, 0), QTimeZone("Europe/Berlin"))); | 51 | f.setDepartureTime(QDateTime(QDate(2018, 3, 18), QTime(18, 44, 0), QTimeZone("Europe/Berlin"))); | ||
50 | f.setDepartureDay(QDate(2018, 3, 18)); | 52 | f.setDepartureDay(QDate(2018, 3, 18)); | ||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |