LMMS
Loading...
Searching...
No Matches
XMLwrapperTest.h
Go to the documentation of this file.
1/*
2 ZynAddSubFX - a software synthesizer
3
4 XMLwrapperTest.h - CxxTest for Misc/XMLwrapper
5 Copyright (C) 2009-2009 Mark McCurry
6 Author: Mark McCurry
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of version 2 of the GNU General Public License
10 as published by the Free Software Foundation.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License (version 2 or later) for more details.
16
17 You should have received a copy of the GNU General Public License (version 2)
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
21*/
22#include <cxxtest/TestSuite.h>
23#include "../Misc/XMLwrapper.h"
24#include <string>
25#include "../globals.h"
27using namespace std;
28
29class XMLwrapperTest:public CxxTest::TestSuite
30{
31 public:
32 void setUp() {
33 xmla = new XMLwrapper;
34 xmlb = new XMLwrapper;
35 }
36
37
38 void testAddPar() {
39 xmla->addpar("my Pa*_ramet@er", 75);
40 TS_ASSERT_EQUALS(xmla->getpar("my Pa*_ramet@er", 0, -200, 200), 75);
41 }
42
43 //here to verify that no leaks occur
44 void testLoad() {
45 string location = string(SOURCE_DIR) + string(
46 "/Tests/guitar-adnote.xmz");
47 xmla->loadXMLfile(location);
48 }
49
51 {
52 string dat =
53 "\n<?xml version=\"1.0f\" encoding=\"UTF-8\"?>\n\
54<!DOCTYPE ZynAddSubFX-data>\n\
55<ZynAddSubFX-data version-major=\"2\" version-minor=\"4\"\n\
56version-revision=\"1\" ZynAddSubFX-author=\"Nasca Octavian Paul\">\n\
57</ZynAddSubFX-data>\n";
58 xmlb->putXMLdata(dat.c_str());
59 }
60
61 void tearDown() {
62 delete xmla;
63 delete xmlb;
64 }
65
66
67 private:
68 XMLwrapper *xmla;
69 XMLwrapper *xmlb;
70};
SYNTH_T * synth
Definition LocalZynAddSubFx.cpp:47
Definition XMLwrapperTest.h:30
void testAddPar()
Definition XMLwrapperTest.h:38
void tearDown()
Definition XMLwrapperTest.h:61
XMLwrapper * xmlb
Definition XMLwrapperTest.h:69
void testAnotherLoad()
Definition XMLwrapperTest.h:50
void setUp()
Definition XMLwrapperTest.h:32
XMLwrapper * xmla
Definition XMLwrapperTest.h:68
void testLoad()
Definition XMLwrapperTest.h:44
Definition juce_Uuid.h:141
Definition globals.h:204
#define SOURCE_DIR
Definition zynaddsubfx-src.cpp:21