Remove Cxxtest dependency
[zynaddsubfx-code.git] / src / Tests / XMLwrapperTest.cpp
blobd397989ad4216bdfb076b4a83be80afa94d90433
1 /*
2 ZynAddSubFX - a software synthesizer
4 XMLwrapperTest.h - CxxTest for Misc/XMLwrapper
5 Copyright (C) 2009-2009 Mark McCurry
6 Author: Mark McCurry
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 #include "test-suite.h"
14 #include "../Misc/XMLwrapper.h"
15 #include <string>
16 #include "../globals.h"
17 using namespace std;
18 using namespace zyn;
20 SYNTH_T *synth;
22 class XMLwrapperTest
24 public:
25 void setUp() {
26 xmla = new XMLwrapper;
27 xmlb = new XMLwrapper;
31 void testAddPar() {
32 xmla->addpar("my Pa*_ramet@er", 75);
33 TS_ASSERT_EQUAL_INT(xmla->getpar("my Pa*_ramet@er", 0, -200, 200), 75);
36 //here to verify that no leaks occur
37 void testLoad() {
38 string location = string(SOURCE_DIR) + string(
39 "/Tests/guitar-adnote.xmz");
40 xmla->loadXMLfile(location);
43 void testAnotherLoad()
45 string dat =
46 "\n<?xml version=\"1.0f\" encoding=\"UTF-8\"?>\n\
47 <!DOCTYPE ZynAddSubFX-data>\n\
48 <ZynAddSubFX-data version-major=\"2\" version-minor=\"4\"\n\
49 version-revision=\"1\" ZynAddSubFX-author=\"Nasca Octavian Paul\">\n\
50 </ZynAddSubFX-data>\n";
51 xmlb->putXMLdata(dat.c_str());
54 void tearDown() {
55 delete xmla;
56 delete xmlb;
60 private:
61 XMLwrapper *xmla;
62 XMLwrapper *xmlb;
65 int main()
67 XMLwrapperTest test;
68 RUN_TEST(testAddPar);
69 RUN_TEST(testLoad);
70 RUN_TEST(testAnotherLoad);
71 return test_summary();