moved libmscore readwriteundoreset test

This commit is contained in:
Igor Korsukov 2020-12-21 10:07:22 +02:00
parent f0178b5ab4
commit dec89dcb2f
8 changed files with 14 additions and 29 deletions

View file

@ -1,16 +0,0 @@
#=============================================================================
# MuseScore
# Music Composition & Notation
#
# Copyright (C) 2011 Werner Schweer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
# as published by the Free Software Foundation and appearing in
# the file LICENSE.GPL
#=============================================================================
set(TARGET tst_readwriteundoreset)
include(${PROJECT_SOURCE_DIR}/mtest/cmake.inc)

View file

@ -52,6 +52,7 @@ set(MODULE_TEST_SRC
# ${CMAKE_CURRENT_LIST_DIR}/tst_midimapping.cpp not ported # ${CMAKE_CURRENT_LIST_DIR}/tst_midimapping.cpp not ported
${CMAKE_CURRENT_LIST_DIR}/tst_note.cpp ${CMAKE_CURRENT_LIST_DIR}/tst_note.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_parts.cpp ${CMAKE_CURRENT_LIST_DIR}/tst_parts.cpp
${CMAKE_CURRENT_LIST_DIR}/tst_readwriteundoreset.cpp
) )

View file

@ -10,12 +10,12 @@
// the file LICENCE.GPL // the file LICENCE.GPL
//============================================================================= //=============================================================================
#include <QtTest/QtTest> #include "testing/qtestsuite.h"
#include "mtest/testutils.h" #include "testutils.h"
#include "libmscore/score.h" #include "libmscore/score.h"
#include "libmscore/undo.h" #include "libmscore/undo.h"
#define DIR QString("libmscore/readwriteundoreset/") static const QString RWUNDORESET_DATA_DIR("readwriteundoreset_data/");
using namespace Ms; using namespace Ms;
@ -23,7 +23,7 @@ using namespace Ms;
// TestReadWrite // TestReadWrite
//--------------------------------------------------------- //---------------------------------------------------------
class TestReadWrite : public QObject, public MTest class TestReadWriteUndoReset : public QObject, public MTest
{ {
Q_OBJECT Q_OBJECT
@ -40,7 +40,7 @@ private slots:
// initTestCase // initTestCase
//--------------------------------------------------------- //---------------------------------------------------------
void TestReadWrite::initTestCase() void TestReadWriteUndoReset::initTestCase()
{ {
initMTest(); initMTest();
} }
@ -49,7 +49,7 @@ void TestReadWrite::initTestCase()
// testReadWriteResetPositions // testReadWriteResetPositions
//--------------------------------------------------------- //---------------------------------------------------------
void TestReadWrite::testReadWriteResetPositions_data() void TestReadWriteUndoReset::testReadWriteResetPositions_data()
{ {
QTest::addColumn<QString>("file"); QTest::addColumn<QString>("file");
@ -58,11 +58,11 @@ void TestReadWrite::testReadWriteResetPositions_data()
QTest::newRow("mmrestBarlineTextLinks") << "mmrestBarlineTextLinks"; // see issue #296426 QTest::newRow("mmrestBarlineTextLinks") << "mmrestBarlineTextLinks"; // see issue #296426
} }
void TestReadWrite::testReadWriteResetPositions() void TestReadWriteUndoReset::testReadWriteResetPositions()
{ {
QFETCH(QString, file); QFETCH(QString, file);
QString readFile(DIR + file + ".mscx"); QString readFile(RWUNDORESET_DATA_DIR + file + ".mscx");
QString writeFile(file + "-undoreset-test.mscx"); QString writeFile(file + "-undoreset-test.mscx");
MasterScore* score = readScore(readFile); MasterScore* score = readScore(readFile);
@ -85,14 +85,14 @@ void TestReadWrite::testReadWriteResetPositions()
/// See issue #296426 /// See issue #296426
//--------------------------------------------------------- //---------------------------------------------------------
void TestReadWrite::testMMRestLinksRecreateMMRest() void TestReadWriteUndoReset::testMMRestLinksRecreateMMRest()
{ {
const QString file("mmrestBarlineTextLinks"); const QString file("mmrestBarlineTextLinks");
QString readFile(DIR + file + ".mscx"); QString readFile(RWUNDORESET_DATA_DIR + file + ".mscx");
QString writeFile(file + "-recreate-mmrest-test.mscx"); QString writeFile(file + "-recreate-mmrest-test.mscx");
QString disableMMRestRefFile(DIR + file + "-disable-mmrest-ref.mscx"); QString disableMMRestRefFile(RWUNDORESET_DATA_DIR + file + "-disable-mmrest-ref.mscx");
QString recreateMMRestRefFile(DIR + file + "-recreate-mmrest-ref.mscx"); QString recreateMMRestRefFile(RWUNDORESET_DATA_DIR + file + "-recreate-mmrest-ref.mscx");
MasterScore* score = readScore(readFile); MasterScore* score = readScore(readFile);
QVERIFY(score); QVERIFY(score);
@ -118,5 +118,5 @@ void TestReadWrite::testMMRestLinksRecreateMMRest()
delete score; delete score;
} }
QTEST_MAIN(TestReadWrite) QTEST_MAIN(TestReadWriteUndoReset)
#include "tst_readwriteundoreset.moc" #include "tst_readwriteundoreset.moc"