Commit b719f8a0 authored by Volker Krause's avatar Volker Krause

Fix unit tests with Qt 5.11

Date/time JSON serialization changed in Qt, so run this back and forth
through our own serialization code instead.
parent 20063b6e
[
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......@@ -23,6 +24,7 @@
"reservationNumber": "123456"
},
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......@@ -46,6 +48,7 @@
"reservationNumber": "123456"
},
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......@@ -69,6 +72,7 @@
"reservationNumber": "123456"
},
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......
[
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......@@ -23,6 +24,7 @@
"reservationNumber": "XXX007"
},
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......
[
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
......
[
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
......@@ -25,6 +26,7 @@
}
},
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
......
[
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
......
[
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
......@@ -26,6 +27,7 @@
}
},
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
......
[
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
"arrivalPlatform": "",
"arrivalStation": {
"@type": "TrainStation",
"name": "Brno hl.n."
......@@ -28,6 +28,7 @@
}
},
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
......@@ -37,7 +38,6 @@
"name": "Berlin Hbf (tief)"
},
"arrivalTime": "2027-11-17T21:15:00",
"departurePlatform": "",
"departureStation": {
"@type": "TrainStation",
"name": "Brno hl.n."
......
[
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
......@@ -20,6 +21,7 @@
"reservationNumber": "XXX007"
},
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
......
[
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
......@@ -9,7 +10,6 @@
"name": "Berlin Hbf (tief)"
},
"arrivalTime": "2027-09-12T21:15:00",
"departurePlatform": "",
"departureStation": {
"@type": "TrainStation",
"name": "Brno hl.n."
......
[
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
......@@ -28,6 +29,7 @@
}
},
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
......@@ -48,6 +50,7 @@
"reservationNumber": "XXX007"
},
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
......@@ -68,10 +71,10 @@
"reservationNumber": "XXX007"
},
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
"arrivalPlatform": "",
"arrivalStation": {
"@type": "TrainStation",
"name": "Berlin Hbf (tief)"
......
[
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
......@@ -20,6 +21,7 @@
"reservationNumber": "XXX007"
},
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
......
[
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......@@ -23,6 +24,7 @@
"reservationNumber": "ABC123"
},
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......
[
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......@@ -25,6 +26,7 @@
"reservationNumber": "ABCDEF"
},
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......
[
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......@@ -25,6 +26,7 @@
"reservationNumber": "XXX007"
},
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......@@ -50,6 +52,7 @@
"reservationNumber": "XXX007"
},
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......@@ -75,6 +78,7 @@
"reservationNumber": "XXX007"
},
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......
[
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......@@ -25,6 +26,7 @@
"reservationNumber": "XXX007"
},
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......@@ -50,6 +52,7 @@
"reservationNumber": "XXX007"
},
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......@@ -75,6 +78,7 @@
"reservationNumber": "XXX007"
},
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......
[
{
"@context": "http://schema.org",
"@type": "BusReservation",
"modifyReservationUrl": "https://jizdenky.studentagency.cz/OnlineTicket?pam1=9876543210&pam2=0123456789",
"reservationFor": {
......@@ -27,6 +28,7 @@
}
},
{
"@context": "http://schema.org",
"@type": "BusReservation",
"modifyReservationUrl": "https://jizdenky.studentagency.cz/OnlineTicket?pam1=9876543210&pam2=0123456789",
"reservationFor": {
......
[
{
"@context": "http://schema.org",
"@type": "BusReservation",
"modifyReservationUrl": "http://jizdenky.studentagency.cz/OnlineTicket?pam1=0987654321&pam2=0123456789",
"reservationFor": {
......
[
{
"@context": "http://schema.org",
"@type": "BusReservation",
"modifyReservationUrl": "https://jizdenky.studentagency.cz/OnlineTicket?pam1=0987654321&pam2=0123456789",
"reservationFor": {
......
[
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"modifyReservationUrl": "https://jizdenky.regiojet.cz/OnlineTicket?pam1=0987654321&pam2=0123456789",
"reservationFor": {
......
[
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationFor": {
"@type": "TrainTrip",
......
[
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......@@ -24,6 +25,7 @@
"reservationNumber": "XXX007"
},
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
......
......@@ -20,6 +20,7 @@
#include "extractor.h"
#include "extractorengine.h"
#include "extractorpreprocessor.h"
#include "jsonlddocument.h"
#include <QDebug>
#include <QDir>
......@@ -74,7 +75,7 @@ private Q_SLOTS:
engine.setText(QString::fromUtf8(f.readAll()));
engine.setSenderDate(QDateTime(QDate(2017, 12, 29), QTime(18, 46, 2)));
engine.setExtractor(&extractor);
const auto data = engine.extract();
const auto data = JsonLdDocument::toJson(JsonLdDocument::fromJson(engine.extract()));
QFile ref(jsonFile);
QVERIFY(ref.open(QFile::ReadOnly));
......@@ -125,7 +126,7 @@ private Q_SLOTS:
engine.setText(preproc.text());
engine.setSenderDate(QDateTime(QDate(2017, 12, 29), QTime(18, 46, 2)));
engine.setExtractor(&extractor);
const auto data = engine.extract();
const auto data = JsonLdDocument::toJson(JsonLdDocument::fromJson(engine.extract()));
QFile ref(jsonFile);
QVERIFY(ref.open(QFile::ReadOnly));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment