1 //=============================================================================
2 //  MuseScore
3 //  Music Composition & Notation
4 //
5 //  Copyright (C) 2012 Werner Schweer
6 //
7 //  This program is free software; you can redistribute it and/or modify
8 //  it under the terms of the GNU General Public License version 2
9 //  as published by the Free Software Foundation and appearing in
10 //  the file LICENCE.GPL
11 //=============================================================================
12 
13 #include <QtTest/QtTest>
14 #include "mtest/testutils.h"
15 #include "libmscore/score.h"
16 
17 #define DIR QString("libmscore/compat206/")
18 
19 using namespace Ms;
20 
21 //---------------------------------------------------------
22 //   TestCompat206
23 //---------------------------------------------------------
24 
25 class TestCompat206 : public QObject, public MTest
26       {
27       Q_OBJECT
28 
29    private slots:
30       void initTestCase();
31       void compat(const QString&);
accidentals()32       void accidentals()      { compat("accidentals");      }
ambitus()33       void ambitus()          { compat("ambitus");          }
articulations()34       void articulations()    { compat("articulations");    }
articulationsDouble()35       void articulationsDouble() { compat("articulations-double"); }
breath()36       void breath()           { compat("breath");           }
clefs()37       void clefs()            { compat("clefs");            }
drumset()38       void drumset()          { compat("drumset");          }
markers()39       void markers()          { compat("markers");          }
noteheads()40       void noteheads()        { compat("noteheads");        }
41 //TODO::ws      void textstyles()       { compat("textstyles");       }
tuplets()42       void tuplets()          { compat("tuplets");          }
hairpin()43       void hairpin()          { compat("hairpin");          }
brlines()44       void brlines()          { compat("barlines");         }
lidEmptyText()45       void lidEmptyText()     { compat("lidemptytext");     }
intrumentNameAlign()46       void intrumentNameAlign() {compat("intrumentNameAlign"); }
fermata()47       void fermata()          { compat("fermata");          }
frame_utf8()48       void frame_utf8()       { compat("frame_text2");      }
user_style()49       void user_style()       { compat("userstylesparts");  }
50       };
51 
52 //---------------------------------------------------------
53 //   initTestCase
54 //---------------------------------------------------------
55 
initTestCase()56 void TestCompat206::initTestCase()
57       {
58       initMTest();
59       }
60 
61 //---------------------------------------------------------
62 //   compat
63 //---------------------------------------------------------
64 
compat(const QString & file)65 void TestCompat206::compat(const QString& file)
66       {
67       QString readFile(DIR   + file + ".mscx");
68       QString writeFile(file + "-test.mscx");
69       QString reference(DIR  + file + "-ref.mscx");
70 
71       MasterScore* score = readScore(readFile);
72       QVERIFY(score);
73       QVERIFY(saveCompareScore(score, writeFile, reference));
74       }
75 
76 QTEST_MAIN(TestCompat206)
77 #include "tst_compat206.moc"
78 
79