Do not require installation before any SQLite-related test

parent ee2326ce
......@@ -10,13 +10,15 @@
#include "akabeipolkitsqliteconnectiontest.h"
#include <QDebug>
#include <QTemporaryFile>
#include <QTest>
#include "PolKitSQLiteConnection.h"
#include <qtemporaryfile.h>
#include "akabeicoreconfig.h"
#include "akabeipackage.h"
#include <akabeiquery.h>
#include <QDebug>
#include "akabeiquery.h"
#include "PolKitSQLiteConnection.h"
#include "common.h"
AkabeiPolkitSQLiteConnectionTest::AkabeiPolkitSQLiteConnectionTest()
{
......@@ -35,7 +37,7 @@ void AkabeiPolkitSQLiteConnectionTest::simpleTest()
file.close();
PolKitSQLiteConnection c(file.fileName(), false);
QFile schemaFile(DB_SCHEMA);
QFile schemaFile(dbSchemaPath());
QVERIFY(schemaFile.open(QIODevice::ReadOnly | QIODevice::Text));
{
// Obtain the schema
......
......@@ -10,7 +10,6 @@
#include "akabeisqlitetest.h"
#include <QCoreApplication>
#include <QDebug>
#include <QTemporaryFile>
#include <QTest>
......@@ -19,6 +18,8 @@
#include "akabeiquery.h"
#include "SQLiteConnection.h"
#include "common.h"
AkabeiSQLiteTest::AkabeiSQLiteTest(QObject * parent) : QObject(parent)
{
......@@ -36,9 +37,7 @@ void AkabeiSQLiteTest::test()
file.close();
SQLiteConnection c(file.fileName(), false);
QString DB_SCHEMA(QCoreApplication::applicationDirPath() +
QStringLiteral("/../../etc/dbschema.sql"));
QFile schemaFile(DB_SCHEMA);
QFile schemaFile(dbSchemaPath());
QVERIFY(schemaFile.open(QIODevice::ReadOnly | QIODevice::Text));
{
// Obtain the schema
......
#include <QCoreApplication>
#include <QString>
QString dbSchemaPath() {
return QCoreApplication::applicationDirPath() +
QStringLiteral("/../../etc/dbschema.sql");
}
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