mirror of
https://github.com/QuasarApp/installer-framework.git
synced 2025-05-19 16:29:33 +00:00
Fix style in tests.
Change-Id: Icebeec79fe25a65e71a8887ebf0f5ca751388cd1 Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
This commit is contained in:
parent
7d5c4a7211
commit
7efffd39ff
@ -77,7 +77,8 @@ void EnvironmentVariableTest::testPersistentNonSystem()
|
|||||||
settings.remove(key);
|
settings.remove(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnvironmentVariableTest::testNonPersistentNonSystem() {
|
void EnvironmentVariableTest::testNonPersistentNonSystem()
|
||||||
|
{
|
||||||
#ifndef Q_OS_WIN
|
#ifndef Q_OS_WIN
|
||||||
QSKIP("This operation only works on Windows",SkipSingle);
|
QSKIP("This operation only works on Windows",SkipSingle);
|
||||||
#endif
|
#endif
|
||||||
|
@ -30,14 +30,16 @@
|
|||||||
|
|
||||||
#include <QtTest/QtTest>
|
#include <QtTest/QtTest>
|
||||||
|
|
||||||
class EnvironmentVariableTest : public QObject {
|
class EnvironmentVariableTest : public QObject
|
||||||
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EnvironmentVariableTest();
|
EnvironmentVariableTest();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void testPersistentNonSystem();
|
void testPersistentNonSystem();
|
||||||
void testNonPersistentNonSystem();
|
void testNonPersistentNonSystem();
|
||||||
private:
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // EXTRACTARCHIVEOPERATIONTEST_H
|
#endif // EXTRACTARCHIVEOPERATIONTEST_H
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
** (qt-info@nokia.com).
|
** (qt-info@nokia.com).
|
||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "extractarchiveoperationtest.h"
|
#include "extractarchiveoperationtest.h"
|
||||||
#include "extractarchiveoperation.h"
|
#include "extractarchiveoperation.h"
|
||||||
|
|
||||||
@ -47,7 +48,8 @@ ExtractArchiveOperationTest::ExtractArchiveOperationTest()
|
|||||||
QInstaller::init();
|
QInstaller::init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtractArchiveOperationTest::init( const QString& outdir ) {
|
void ExtractArchiveOperationTest::init(const QString &outdir)
|
||||||
|
{
|
||||||
if (QDir(outdir).exists()) {
|
if (QDir(outdir).exists()) {
|
||||||
QFAIL("output directory already exists!");
|
QFAIL("output directory already exists!");
|
||||||
QVERIFY(false);
|
QVERIFY(false);
|
||||||
@ -56,7 +58,8 @@ void ExtractArchiveOperationTest::init( const QString& outdir ) {
|
|||||||
QVERIFY(cd.mkdir(outdir));
|
QVERIFY(cd.mkdir(outdir));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool recursiveRemove( const QString& path, QString* errorMsg ) {
|
static bool recursiveRemove(const QString &path, QString *errorMsg)
|
||||||
|
{
|
||||||
if (errorMsg)
|
if (errorMsg)
|
||||||
errorMsg->clear();
|
errorMsg->clear();
|
||||||
if (!QFileInfo(path).exists())
|
if (!QFileInfo(path).exists())
|
||||||
@ -103,7 +106,8 @@ static bool recursiveRemove( const QString& path, QString* errorMsg ) {
|
|||||||
return !error;
|
return !error;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtractArchiveOperationTest::cleanup( const QString& dir ) {
|
void ExtractArchiveOperationTest::cleanup(const QString &dir)
|
||||||
|
{
|
||||||
QDir d(dir);
|
QDir d(dir);
|
||||||
QString msg;
|
QString msg;
|
||||||
const bool removed = recursiveRemove(dir, &msg);
|
const bool removed = recursiveRemove(dir, &msg);
|
||||||
@ -112,7 +116,8 @@ void ExtractArchiveOperationTest::cleanup( const QString& dir ) {
|
|||||||
QVERIFY(removed);
|
QVERIFY(removed);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtractArchiveOperationTest::testExtraction() {
|
void ExtractArchiveOperationTest::testExtraction()
|
||||||
|
{
|
||||||
const QString outdir = QLatin1String("test-extract-out" );
|
const QString outdir = QLatin1String("test-extract-out" );
|
||||||
init(outdir);
|
init(outdir);
|
||||||
KDUpdater::Application app;
|
KDUpdater::Application app;
|
||||||
@ -126,7 +131,8 @@ void ExtractArchiveOperationTest::testExtraction() {
|
|||||||
cleanup(outdir);
|
cleanup(outdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtractArchiveOperationTest::testExtractionErrors() {
|
void ExtractArchiveOperationTest::testExtractionErrors()
|
||||||
|
{
|
||||||
const QString outdir = QLatin1String("test-extract-out");
|
const QString outdir = QLatin1String("test-extract-out");
|
||||||
init(outdir);
|
init(outdir);
|
||||||
KDUpdater::Application app;
|
KDUpdater::Application app;
|
||||||
@ -141,7 +147,8 @@ void ExtractArchiveOperationTest::testExtractionErrors() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtractArchiveOperationTest::testInvalidArchive() {
|
void ExtractArchiveOperationTest::testInvalidArchive()
|
||||||
|
{
|
||||||
const QString outdir = QLatin1String("test-extract-out");
|
const QString outdir = QLatin1String("test-extract-out");
|
||||||
init(outdir);
|
init(outdir);
|
||||||
KDUpdater::Application app;
|
KDUpdater::Application app;
|
||||||
|
@ -30,14 +30,18 @@
|
|||||||
|
|
||||||
#include <QtTest/QtTest>
|
#include <QtTest/QtTest>
|
||||||
|
|
||||||
class ExtractArchiveOperationTest : public QObject {
|
class ExtractArchiveOperationTest : public QObject
|
||||||
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ExtractArchiveOperationTest();
|
ExtractArchiveOperationTest();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void testExtraction();
|
void testExtraction();
|
||||||
void testInvalidArchive();
|
void testInvalidArchive();
|
||||||
void testExtractionErrors();
|
void testExtractionErrors();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init(const QString &);
|
void init(const QString &);
|
||||||
void cleanup(const QString &);
|
void cleanup(const QString &);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user