From 27b4ef321ade223902ab083aa5a100962c7295f9 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 27 Dec 2016 13:31:30 +0100 Subject: [PATCH] Correctly open the resource file Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- core/qthelper.cpp | 2 +- tests/testparse.cpp | 6 ++++++ tests/testparse.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/qthelper.cpp b/core/qthelper.cpp index e0a5b1556..885e89d98 100644 --- a/core/qthelper.cpp +++ b/core/qthelper.cpp @@ -320,7 +320,7 @@ static xmlDocPtr get_stylesheet_doc(const xmlChar *uri, xmlDictPtr, int, void *, QFile f(QLatin1String(":/xslt/") + (const char *)uri); if (!f.open(QIODevice::ReadOnly)) { if (verbose > 0) { - qDebug() << "cannot open stylesheet" << QLatin1String(":/xslt/") + (const char *)uri; + qDebug() << "cannot open stylesheet" << QLatin1String(":/xslt/") + (const char *)uri << f.errorString(); return NULL; } } diff --git a/tests/testparse.cpp b/tests/testparse.cpp index 8d4cedb43..e9d313e5d 100644 --- a/tests/testparse.cpp +++ b/tests/testparse.cpp @@ -4,6 +4,12 @@ #include "core/divelist.h" #include +void TestParse::initTestCase() +{ + /* we need to manually tell that the resource exists, because we are using it as library. */ + Q_INIT_RESOURCE(subsurface); +} + char *intdup(int index) { char tmpbuf[21]; diff --git a/tests/testparse.h b/tests/testparse.h index 5616f0718..d99f9e53e 100644 --- a/tests/testparse.h +++ b/tests/testparse.h @@ -6,6 +6,7 @@ class TestParse : public QObject{ Q_OBJECT private slots: + void initTestCase(); void testParseCSV(); void testParseDivingLog(); void testParseV2NoQuestion();