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.

638 lines
19KB

  1. /*
  2. * Carla Utility Tests
  3. * Copyright (C) 2013-2014 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * For a full copy of the GNU General Public License see the doc/GPL.txt file.
  16. */
  17. #ifdef NDEBUG
  18. # error Build this file with debug ON please
  19. #endif
  20. #define HAVE_JUCE
  21. #define VESTIGE_HEADER
  22. #include "CarlaUtils.hpp"
  23. #include "CarlaMathUtils.hpp"
  24. #undef NULL
  25. #define NULL nullptr
  26. #include "CarlaBackendUtils.hpp"
  27. #include "CarlaEngineUtils.hpp"
  28. #include "CarlaLadspaUtils.hpp"
  29. #include "CarlaDssiUtils.hpp"
  30. #include "CarlaLv2Utils.hpp"
  31. #include "CarlaVstUtils.hpp"
  32. // used in dssi utils
  33. #include "juce_core.h"
  34. #include <QtCore/QDir>
  35. #include <QtCore/QFileInfo>
  36. #include <QtCore/QStringList>
  37. // #include "CarlaBridgeUtils.hpp"
  38. // #include "CarlaJuceUtils.hpp"
  39. // #include "CarlaLibUtils.hpp"
  40. // #include "CarlaOscUtils.hpp"
  41. // #include "CarlaShmUtils.hpp"
  42. // #include "CarlaStateUtils.hpp"
  43. // #include "CarlaVstUtils.hpp"
  44. // #include "CarlaLibCounter.hpp"
  45. // #include "CarlaLogThread.hpp"
  46. // #include "CarlaRingBuffer.hpp"
  47. // #include "CarlaThread.hpp"
  48. // #include "Lv2AtomQueue.hpp"
  49. // #include "JucePluginWindow.hpp"
  50. #if 0
  51. // -----------------------------------------------------------------------
  52. static void test_CarlaUtils() noexcept
  53. {
  54. // -------------------------------------------------------------------
  55. // misc functions
  56. {
  57. bool2str(false);
  58. bool2str(true);
  59. pass();
  60. char strBuf[1];
  61. nullStrBuf(strBuf);
  62. }
  63. // -------------------------------------------------------------------
  64. // string print functions
  65. {
  66. carla_debug("DEBUG");
  67. carla_stdout("STDOUT %s", bool2str(true));
  68. carla_stderr("STDERR %s", bool2str(false));
  69. carla_stderr2("STDERR2 " P_UINT64, 0xffffffff); // 4294967295
  70. }
  71. // -------------------------------------------------------------------
  72. // carla_*sleep
  73. {
  74. //carla_sleep(1);
  75. //carla_msleep(1);
  76. }
  77. // -------------------------------------------------------------------
  78. // carla_setenv
  79. {
  80. carla_setenv("THIS", "THAT");
  81. assert(std::strcmp(std::getenv("THIS"), "THAT") == 0);
  82. }
  83. // -------------------------------------------------------------------
  84. // carla_strdup
  85. {
  86. // with variables
  87. const char* const str1(carla_strdup("string1"));
  88. const char* const strF(carla_strdup_free(strdup("string2")));
  89. delete[] str1;
  90. delete[] strF;
  91. // without variables
  92. delete[] carla_strdup("string3");
  93. delete[] carla_strdup_free(strdup("string4"));
  94. // common use case in Carla code
  95. struct TestStruct {
  96. const char* str1;
  97. const char* str2;
  98. const char* str3;
  99. const char* str4;
  100. TestStruct()
  101. : str1(carla_strdup("str1")),
  102. str2(carla_strdup("str2")),
  103. str3(nullptr),
  104. str4(carla_strdup("str4")) {}
  105. ~TestStruct() noexcept
  106. {
  107. if (str1 != nullptr)
  108. {
  109. delete[] str1;
  110. str1 = nullptr;
  111. }
  112. if (str2 != nullptr)
  113. {
  114. delete[] str2;
  115. str2 = nullptr;
  116. }
  117. if (str3 != nullptr)
  118. {
  119. delete[] str3;
  120. str3 = nullptr;
  121. }
  122. if (str4 != nullptr)
  123. {
  124. delete[] str4;
  125. str4 = nullptr;
  126. }
  127. }
  128. };
  129. TestStruct a, b, c;
  130. }
  131. // -------------------------------------------------------------------
  132. // memory functions
  133. {
  134. int a[] = { 4, 3, 2, 1 };
  135. int b[] = { 1, 2, 3, 4 };
  136. carla_add(a, b, 4);
  137. assert(a[0] == 5);
  138. assert(a[1] == 5);
  139. assert(a[2] == 5);
  140. assert(a[3] == 5);
  141. int c[] = { 4, 3, 2, 1 };
  142. carla_add(b, c, 4);
  143. assert(a[0] == b[0]);
  144. assert(a[1] == b[1]);
  145. assert(a[2] == b[2]);
  146. assert(a[3] == b[3]);
  147. carla_copy(a, c, 2);
  148. carla_copy(b+2, c+2, 2);
  149. assert(a[0] == c[0]);
  150. assert(a[1] == c[1]);
  151. assert(b[2] == c[2]);
  152. assert(b[3] == c[3]);
  153. carla_copy(c, a, 4);
  154. assert(a[0] == c[0]);
  155. assert(a[1] == c[1]);
  156. assert(a[2] == c[2]);
  157. assert(a[3] == c[3]);
  158. carla_fill(a, 0, 4);
  159. assert(a[0] == 0);
  160. assert(a[1] == 0);
  161. assert(a[2] == 0);
  162. assert(a[3] == 0);
  163. carla_fill(a, -11, 4);
  164. assert(a[0] == -11);
  165. assert(a[1] == -11);
  166. assert(a[2] == -11);
  167. assert(a[3] == -11);
  168. carla_fill(a+0, 17, 2);
  169. carla_fill(a+2, 23, 2);
  170. assert(a[0] == 17);
  171. assert(a[1] == 17);
  172. assert(a[2] == 23);
  173. assert(a[3] == 23);
  174. carla_zeroBytes(a, sizeof(int)*4);
  175. assert(a[0] == 0);
  176. assert(a[1] == 0);
  177. assert(a[2] == 0);
  178. assert(a[3] == 0);
  179. char strBuf[501];
  180. strBuf[0] = strBuf[499] = strBuf[500] = '!';
  181. carla_zeroChar(strBuf, 501);
  182. for (int i=0; i<501; ++i)
  183. assert(strBuf[i] == '\0');
  184. int d = 1527, e = 0;
  185. carla_add(&d, &d, 1);
  186. carla_add(&d, &e, 1);
  187. carla_add(&e, &d, 1);
  188. assert(d == 1527*2);
  189. assert(d == e);
  190. e = -e;
  191. carla_add(&d, &e, 1);
  192. assert(d == 0);
  193. carla_copy(&d, &e, 1);
  194. assert(d == -1527*2);
  195. assert(d == e);
  196. carla_fill(&d, 9999, 1);
  197. carla_fill(&e, 123, 1);
  198. assert(d == 9999);
  199. assert(e == 123);
  200. carla_zeroStruct(d);
  201. assert(d == 0);
  202. carla_copyStruct(d, e);
  203. assert(d != 0);
  204. assert(d == e);
  205. carla_fill(a+0, 1, 1);
  206. carla_fill(a+1, 2, 1);
  207. carla_fill(a+2, 3, 1);
  208. carla_fill(a+3, 4, 1);
  209. assert(a[0] == 1);
  210. assert(a[1] == 2);
  211. assert(a[2] == 3);
  212. assert(a[3] == 4);
  213. carla_copyStruct(c, a, 4);
  214. assert(c[0] == a[0]);
  215. assert(c[1] == a[1]);
  216. assert(c[2] == a[2]);
  217. assert(c[3] == a[3]);
  218. carla_zeroStruct(c, 4);
  219. assert(c[0] == 0);
  220. assert(c[1] == 0);
  221. assert(c[2] == 0);
  222. assert(c[3] == 0);
  223. float fl[5];
  224. carla_fill(fl, 1.11f, 5);
  225. assert(fl[0] == 1.11f);
  226. assert(fl[1] == 1.11f);
  227. assert(fl[2] == 1.11f);
  228. assert(fl[3] == 1.11f);
  229. assert(fl[4] == 1.11f);
  230. carla_add(fl, fl, 5);
  231. assert(fl[0] == 1.11f*2);
  232. assert(fl[1] == 1.11f*2);
  233. assert(fl[2] == 1.11f*2);
  234. assert(fl[3] == 1.11f*2);
  235. assert(fl[4] == 1.11f*2);
  236. carla_add(fl, fl, 4);
  237. assert(fl[0] == 1.11f*4);
  238. assert(fl[1] == 1.11f*4);
  239. assert(fl[2] == 1.11f*4);
  240. assert(fl[3] == 1.11f*4);
  241. assert(fl[4] == 1.11f*2);
  242. carla_add(fl, fl, 3);
  243. assert(fl[0] == 1.11f*8);
  244. assert(fl[1] == 1.11f*8);
  245. assert(fl[2] == 1.11f*8);
  246. assert(fl[3] == 1.11f*4);
  247. assert(fl[4] == 1.11f*2);
  248. carla_add(fl, fl, 2);
  249. assert(fl[0] == 1.11f*16);
  250. assert(fl[1] == 1.11f*16);
  251. assert(fl[2] == 1.11f*8);
  252. assert(fl[3] == 1.11f*4);
  253. assert(fl[4] == 1.11f*2);
  254. carla_add(fl, fl, 1);
  255. assert(fl[0] == 1.11f*32);
  256. assert(fl[1] == 1.11f*16);
  257. assert(fl[2] == 1.11f*8);
  258. assert(fl[3] == 1.11f*4);
  259. assert(fl[4] == 1.11f*2);
  260. }
  261. }
  262. // -----------------------------------------------------------------------
  263. static void test_CarlaMathUtils() noexcept
  264. {
  265. // -------------------------------------------------------------------
  266. // math functions (base)
  267. // Return the lower of 2 values, with 'min' as the minimum possible value.
  268. assert(carla_min(0, 0, 0) == 0);
  269. assert(carla_min(0, 3, 0) == 0);
  270. assert(carla_min(3, 0, 0) == 0);
  271. assert(carla_min(0, 0, 3) == 3);
  272. assert(carla_min(0, 1, 3) == 3);
  273. assert(carla_min(0, 2, 3) == 3);
  274. assert(carla_min(0, 3, 3) == 3);
  275. assert(carla_min(0, 4, 3) == 3);
  276. assert(carla_min(5, 0, 3) == 3);
  277. assert(carla_min(5, 1, 3) == 3);
  278. assert(carla_min(5, 2, 3) == 3);
  279. assert(carla_min(5, 3, 3) == 3);
  280. assert(carla_min(5, 4, 3) == 4);
  281. assert(carla_min(5, 5, 3) == 5);
  282. assert(carla_min(5, 6, 3) == 5);
  283. assert(carla_min(2, -2, 0) == 0);
  284. assert(carla_min(2, -1, 0) == 0);
  285. assert(carla_min(2, 0, 0) == 0);
  286. assert(carla_min(2, 1, 0) == 1);
  287. assert(carla_min(2, 2, 0) == 2);
  288. assert(carla_min(5, -6, 3) == 3);
  289. assert(carla_min(5, -5, 3) == 3);
  290. assert(carla_min(5, -4, 3) == 3);
  291. assert(carla_min(5, -3, 3) == 3);
  292. assert(carla_min(5, -2, 3) == 3);
  293. assert(carla_min(5, -1, 3) == 3);
  294. assert(carla_min(5, 0, 3) == 3);
  295. assert(carla_min(5, 1, 3) == 3);
  296. assert(carla_min(5, 2, 3) == 3);
  297. assert(carla_min(5, 3, 3) == 3);
  298. assert(carla_min(5, 4, 3) == 4);
  299. assert(carla_min(5, 5, 3) == 5);
  300. assert(carla_min(5, 6, 3) == 5);
  301. assert(carla_min(5, -6, -3) == -3);
  302. assert(carla_min(5, -5, -3) == -3);
  303. assert(carla_min(5, -4, -3) == -3);
  304. assert(carla_min(5, -3, -3) == -3);
  305. assert(carla_min(5, -2, -3) == -2);
  306. assert(carla_min(5, -1, -3) == -1);
  307. assert(carla_min(5, 0, -3) == 0);
  308. assert(carla_min(5, 1, -3) == 1);
  309. assert(carla_min(5, 2, -3) == 2);
  310. assert(carla_min(5, 3, -3) == 3);
  311. assert(carla_min(5, 4, -3) == 4);
  312. assert(carla_min(5, 5, -3) == 5);
  313. assert(carla_min(5, 6, -3) == 5);
  314. // Return the lower positive of 2 values.
  315. assert(carla_minPositive(0, 0) == 0);
  316. assert(carla_minPositive(0, 1) == 0);
  317. assert(carla_minPositive(0, 2) == 0);
  318. assert(carla_minPositive(0, 3) == 0);
  319. assert(carla_minPositive(1, 0) == 0);
  320. assert(carla_minPositive(1, 1) == 1);
  321. assert(carla_minPositive(1, 2) == 1);
  322. assert(carla_minPositive(1, 3) == 1);
  323. assert(carla_minPositive(3, 0) == 0);
  324. assert(carla_minPositive(3, 1) == 1);
  325. assert(carla_minPositive(3, 2) == 2);
  326. assert(carla_minPositive(3, 3) == 3);
  327. assert(carla_minPositive(-1, 0) == 0);
  328. assert(carla_minPositive(-1, 1) == 1);
  329. assert(carla_minPositive(-1, 2) == 2);
  330. assert(carla_minPositive(-1, 3) == 3);
  331. // Return the higher of 2 values, with 'max' as the maximum possible value.
  332. assert(carla_max(0, 0, 0) == 0);
  333. assert(carla_max(0, 3, 0) == 0);
  334. assert(carla_max(3, 0, 0) == 0);
  335. assert(carla_max(0, 0, 3) == 0);
  336. assert(carla_max(0, 1, 3) == 1);
  337. assert(carla_max(0, 2, 3) == 2);
  338. assert(carla_max(0, 3, 3) == 3);
  339. assert(carla_max(0, 4, 3) == 3);
  340. assert(carla_max(5, 0, 3) == 3);
  341. assert(carla_max(5, 1, 3) == 3);
  342. assert(carla_max(5, 2, 3) == 3);
  343. assert(carla_max(5, 3, 3) == 3);
  344. assert(carla_max(5, 4, 3) == 3);
  345. assert(carla_max(5, 5, 3) == 3);
  346. assert(carla_max(5, 6, 3) == 3);
  347. // Fix bounds of 'value' between 'min' and 'max'.
  348. assert(carla_fixValue(0, 1, -1) == 0);
  349. assert(carla_fixValue(0, 1, 0) == 0);
  350. assert(carla_fixValue(0, 1, 1) == 1);
  351. assert(carla_fixValue(0, 1, 2) == 1);
  352. assert(carla_fixValue(0.0, 1.0, -1.0) == 0.0);
  353. assert(carla_fixValue(0.0, 1.0, 0.0) == 0.0);
  354. assert(carla_fixValue(0.0, 1.0, 1.0) == 1.0);
  355. assert(carla_fixValue(0.0, 1.0, 2.0) == 1.0);
  356. assert(carla_fixValue(0.0, 1.0, -0.1) == 0.0);
  357. assert(carla_fixValue(0.0, 1.0, 1.1) == 1.0);
  358. // Get next power of 2.
  359. assert(carla_nextPowerOf2(0) == 0);
  360. assert(carla_nextPowerOf2(1) == 1);
  361. assert(carla_nextPowerOf2(2) == 2);
  362. assert(carla_nextPowerOf2(4) == 4);
  363. assert(carla_nextPowerOf2(5) == 8);
  364. assert(carla_nextPowerOf2(6) == 8);
  365. assert(carla_nextPowerOf2(7) == 8);
  366. assert(carla_nextPowerOf2(8) == 8);
  367. assert(carla_nextPowerOf2(9) == 16);
  368. uint32_t power = 1;
  369. assert((power = carla_nextPowerOf2(power+1)) == 2);
  370. assert((power = carla_nextPowerOf2(power+1)) == 4);
  371. assert((power = carla_nextPowerOf2(power+1)) == 8);
  372. assert((power = carla_nextPowerOf2(power+1)) == 16);
  373. assert((power = carla_nextPowerOf2(power+1)) == 32);
  374. assert((power = carla_nextPowerOf2(power+1)) == 64);
  375. assert((power = carla_nextPowerOf2(power+1)) == 128);
  376. assert((power = carla_nextPowerOf2(power+1)) == 256);
  377. assert((power = carla_nextPowerOf2(power+1)) == 512);
  378. assert((power = carla_nextPowerOf2(power+1)) == 1024);
  379. assert((power = carla_nextPowerOf2(power+1)) == 2048);
  380. assert((power = carla_nextPowerOf2(power+1)) == 4096);
  381. assert((power = carla_nextPowerOf2(power+1)) == 8192);
  382. assert((power = carla_nextPowerOf2(power+1)) == 16384);
  383. assert((power = carla_nextPowerOf2(power+1)) == 32768);
  384. assert((power = carla_nextPowerOf2(power+1)) == 65536);
  385. assert((power = carla_nextPowerOf2(power+1)) == 131072);
  386. // -------------------------------------------------------------------
  387. // math functions (extended)
  388. // carla_addFloat, carla_copyFloat & carla_zeroFloat tests skipped
  389. // mostly unused due to juce::FloatVectorOperations
  390. }
  391. // -----------------------------------------------------------------------
  392. static void test_CarlaBackendUtils() noexcept
  393. {
  394. CARLA_BACKEND_USE_NAMESPACE
  395. carla_stdout(PluginOption2Str(PLUGIN_OPTION_FIXED_BUFFERS));
  396. carla_stdout(BinaryType2Str(BINARY_NONE));
  397. carla_stdout(PluginType2Str(PLUGIN_NONE));
  398. carla_stdout(PluginCategory2Str(PLUGIN_CATEGORY_NONE));
  399. carla_stdout(ParameterType2Str(PARAMETER_UNKNOWN));
  400. carla_stdout(InternalParameterIndex2Str(PARAMETER_NULL));
  401. carla_stdout(EngineCallbackOpcode2Str(ENGINE_CALLBACK_DEBUG));
  402. carla_stdout(EngineOption2Str(ENGINE_OPTION_DEBUG));
  403. carla_stdout(EngineProcessMode2Str(ENGINE_PROCESS_MODE_SINGLE_CLIENT));
  404. carla_stdout(EngineTransportMode2Str(ENGINE_TRANSPORT_MODE_INTERNAL));
  405. carla_stdout(FileCallbackOpcode2Str(FILE_CALLBACK_DEBUG));
  406. carla_stdout(getPluginTypeAsString(PLUGIN_INTERNAL));
  407. carla_stdout(PatchbayIcon2Str(PATCHBAY_ICON_APPLICATION));
  408. getPluginTypeFromString("none");
  409. getPluginCategoryFromName("cat");
  410. }
  411. // -----------------------------------------------------------------------
  412. static void test_CarlaEngineUtils() noexcept
  413. {
  414. CARLA_BACKEND_USE_NAMESPACE
  415. carla_stdout(EngineType2Str(kEngineTypeNull));
  416. carla_stdout(EnginePortType2Str(kEnginePortTypeNull));
  417. carla_stdout(EngineEventType2Str(kEngineEventTypeNull));
  418. carla_stdout(EngineControlEventType2Str(kEngineControlEventTypeNull));
  419. }
  420. // -----------------------------------------------------------------------
  421. static void test_CarlaLadspaUtils() noexcept
  422. {
  423. LADSPA_Descriptor desc;
  424. carla_zeroStruct(desc);
  425. LADSPA_RDF_Descriptor rdfDesc;
  426. delete ladspa_rdf_dup(&rdfDesc);
  427. is_ladspa_port_good(0x0, 0x0);
  428. is_ladspa_rdf_descriptor_valid(&rdfDesc, &desc);
  429. get_default_ladspa_port_value(0x0, -1.0f, 1.0f);
  430. }
  431. // -----------------------------------------------------------------------
  432. namespace dssi_juce {
  433. const char* find_dssi_ui(const char* const filename, const char* const label) noexcept;
  434. #define HAVE_JUCE
  435. #include "CarlaDssiUtils.cpp"
  436. }
  437. namespace dssi_qt {
  438. const char* find_dssi_ui(const char* const filename, const char* const label) noexcept;
  439. #undef HAVE_JUCE
  440. #include "CarlaDssiUtils.cpp"
  441. }
  442. static void test_CarlaDssiUtils() noexcept
  443. {
  444. const char* const ui_juce = dssi_juce::find_dssi_ui("/usr/lib/dssi/trivial_sampler.so", "aa");
  445. const char* const ui_qt = dssi_qt::find_dssi_ui("/usr/lib/dssi/trivial_sampler.so", "aa");
  446. CARLA_SAFE_ASSERT(ui_juce != nullptr);
  447. CARLA_SAFE_ASSERT(ui_qt != nullptr);
  448. if (ui_juce != nullptr)
  449. {
  450. carla_stdout("%s", ui_juce);
  451. assert(std::strcmp(ui_juce, "/usr/lib/dssi/trivial_sampler/trivial_sampler_qt") == 0);
  452. delete[] ui_juce;
  453. }
  454. if (ui_qt != nullptr)
  455. {
  456. carla_stdout("%s", ui_qt);
  457. assert(std::strcmp(ui_qt, "/usr/lib/dssi/trivial_sampler/trivial_sampler_qt") == 0);
  458. delete[] ui_qt;
  459. }
  460. }
  461. // -----------------------------------------------------------------------
  462. static LV2_URID test_lv2_uridMap(LV2_URID_Map_Handle, const char*)
  463. {
  464. return 1;
  465. }
  466. static void test_CarlaLv2Utils() noexcept
  467. {
  468. Lv2WorldClass& lv2World(Lv2WorldClass::getInstance());
  469. lv2World.initIfNeeded();
  470. // getPlugin
  471. const LilvPlugin* const plugin(lv2World.getPlugin("urn:juced:DrumSynth"));
  472. CARLA_SAFE_ASSERT(plugin != nullptr);
  473. // getState
  474. LV2_URID_Map uridMap = { nullptr, test_lv2_uridMap };
  475. LilvState* const state(lv2World.getState("http://arcticanaudio.com/plugins/thefunction#preset001", &uridMap));
  476. CARLA_SAFE_ASSERT(state != nullptr);
  477. if (state != nullptr) lilv_state_free(state);
  478. // load a bunch of plugins to stress test lilv
  479. delete lv2_rdf_new("http://arcticanaudio.com/plugins/thefunction", true);
  480. delete lv2_rdf_new("http://kunz.corrupt.ch/products/tal-noisemaker", true);
  481. delete lv2_rdf_new("http://calf.sourceforge.net/plugins/Reverb", true);
  482. delete lv2_rdf_new("http://www.openavproductions.com/fabla", true);
  483. delete lv2_rdf_new("http://invadarecords.com/plugins/lv2/meter", true);
  484. delete lv2_rdf_new("http://gareus.org/oss/lv2/meters#spectr30stereo", true);
  485. delete lv2_rdf_new("http://plugin.org.uk/swh-plugins/revdelay", true);
  486. delete lv2_rdf_new("http://lv2plug.in/plugins/eg-scope#Stereo", true);
  487. delete lv2_rdf_new("http://kxstudio.sf.net/carla/plugins/carlarack", true);
  488. delete lv2_rdf_new("http://guitarix.sourceforge.net/plugins/gxautowah#autowah", true);
  489. delete lv2_rdf_new("http://github.com/blablack/ams-lv2/mixer_4ch", true);
  490. delete lv2_rdf_new("http://drumgizmo.org/lv2", true);
  491. delete lv2_rdf_new("http://synthv1.sourceforge.net/lv2", true);
  492. delete lv2_rdf_new("urn:juced:DrumSynth", true);
  493. // misc
  494. is_lv2_port_supported(0x0);
  495. is_lv2_feature_supported("test1");
  496. is_lv2_ui_feature_supported("test2");
  497. }
  498. #endif
  499. // -----------------------------------------------------------------------
  500. static intptr_t test_vst_dispatcher(AEffect*, int, int, intptr_t, void*, float)
  501. {
  502. return 0;
  503. }
  504. static void test_CarlaVstUtils() noexcept
  505. {
  506. AEffect effect;
  507. carla_zeroStruct(effect);
  508. effect.dispatcher = test_vst_dispatcher;
  509. vstPluginCanDo(&effect, "test");
  510. carla_stdout(vstEffectOpcode2str(effOpen));
  511. carla_stdout(vstMasterOpcode2str(audioMasterAutomate));
  512. }
  513. // -----------------------------------------------------------------------
  514. // main
  515. int main()
  516. {
  517. // already tested, skip for now
  518. // test_CarlaUtils();
  519. // test_CarlaMathUtils();
  520. //
  521. // test_CarlaBackendUtils();
  522. // test_CarlaEngineUtils();
  523. //
  524. // test_CarlaLadspaUtils();
  525. // test_CarlaDssiUtils();
  526. // test_CarlaLv2Utils();
  527. test_CarlaVstUtils();
  528. return 0;
  529. }
  530. // -----------------------------------------------------------------------