More warnings in AbstractTest::CopyRecursively. Do copy files before all test

run.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-07-25 18:25:13 +03:00
parent 439b1577f5
commit c793f869e5
5 changed files with 12 additions and 9 deletions

View File

@ -140,6 +140,7 @@ bool AbstractTest::CopyRecursively(const QString &srcFilePath, const QString &tg
targetDir.cdUp();
if (not targetDir.mkdir(QFileInfo(tgtFilePath).fileName()))
{
QWARN("Can't create subdir./n");
return false;
}
QDir sourceDir(srcFilePath);
@ -154,10 +155,12 @@ bool AbstractTest::CopyRecursively(const QString &srcFilePath, const QString &tg
return false;
}
}
} else
}
else
{
if (not QFile::copy(srcFilePath, tgtFilePath))
{
QWARN("Can't copy file./n");
return false;
}
}

View File

@ -40,7 +40,7 @@ TST_TapeCommandLine::TST_TapeCommandLine(QObject *parent)
}
//---------------------------------------------------------------------------------------------------------------------
void TST_TapeCommandLine::init()
void TST_TapeCommandLine::initTestCase()
{
QDir tmpDir(tmpTestFolder);
if (not tmpDir.removeRecursively())
@ -141,7 +141,7 @@ void TST_TapeCommandLine::OpenMeasurements()
}
//---------------------------------------------------------------------------------------------------------------------
void TST_TapeCommandLine::cleanup()
void TST_TapeCommandLine::cleanupTestCase()
{
QDir tmpDir(tmpTestFolder);
if (not tmpDir.removeRecursively())

View File

@ -38,10 +38,10 @@ public:
explicit TST_TapeCommandLine(QObject *parent = nullptr);
private slots:
void init();
void initTestCase();
void OpenMeasurements_data() const;
void OpenMeasurements();
void cleanup();
void cleanupTestCase();
private:
Q_DISABLE_COPY(TST_TapeCommandLine)

View File

@ -41,7 +41,7 @@ TST_ValentinaCommandLine::TST_ValentinaCommandLine(QObject *parent)
//---------------------------------------------------------------------------------------------------------------------
// cppcheck-suppress unusedFunction
void TST_ValentinaCommandLine::init()
void TST_ValentinaCommandLine::initTestCase()
{
{// Test files
QDir tmpDir(tmpTestFolder);
@ -308,7 +308,7 @@ void TST_ValentinaCommandLine::TestOpenCollection()
//---------------------------------------------------------------------------------------------------------------------
// cppcheck-suppress unusedFunction
void TST_ValentinaCommandLine::cleanup()
void TST_ValentinaCommandLine::cleanupTestCase()
{
{
QDir tmpDir(tmpTestFolder);

View File

@ -38,7 +38,7 @@ public:
explicit TST_ValentinaCommandLine(QObject *parent = nullptr);
private slots:
void init();
void initTestCase();
void OpenPatterns_data() const;
void OpenPatterns();
void ExportMode_data() const;
@ -47,7 +47,7 @@ private slots:
void TestMode();
void TestOpenCollection_data() const;
void TestOpenCollection();
void cleanup();
void cleanupTestCase();
private:
Q_DISABLE_COPY(TST_ValentinaCommandLine)