Commit c53c7e92 authored by Volker Krause's avatar Volker Krause
Browse files

Fix test failures in builds without ZXing

parent e77c04e7
......@@ -15,6 +15,7 @@
#include <transfermanager.h>
#include <tripgroupmanager.h>
#include <KItinerary/ExtractorCapabilities>
#include <KItinerary/File>
#include <QUrl>
......@@ -34,6 +35,11 @@ private:
return f.readAll();
}
bool hasZxing()
{
return KItinerary::ExtractorCapabilities::capabilitiesString().contains(QLatin1String("zxing"), Qt::CaseInsensitive);
}
private Q_SLOTS:
void initTestCase()
{
......@@ -75,6 +81,9 @@ private Q_SLOTS:
QCOMPARE(passSpy.size(), 1);
QCOMPARE(infoSpy.size(), 3);
appController.importData(readFile(QLatin1String(SOURCE_DIR "/data/iata-bcbp-demo.pdf")));
if (!hasZxing()) {
QSKIP("Built without ZXing");
}
QCOMPARE(resSpy.size(), 4);
QCOMPARE(passSpy.size(), 1);
QCOMPARE(infoSpy.size(), 4);
......@@ -111,6 +120,9 @@ private Q_SLOTS:
QCOMPARE(passSpy.size(), 1);
QCOMPARE(infoSpy.size(), 2);
appController.importFromUrl(QUrl::fromLocalFile(QLatin1String(SOURCE_DIR "/data/iata-bcbp-demo.pdf")));
if (!hasZxing()) {
QSKIP("Built without ZXing");
}
QCOMPARE(resSpy.size(), 3);
QCOMPARE(passSpy.size(), 1);
QCOMPARE(infoSpy.size(), 3);
......
Supports Markdown
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