Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.0KB

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