summaryrefslogtreecommitdiff
path: root/test/lv2.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2020-09-19 15:12:08 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2020-09-19 15:14:24 +0200
commit62e577cee9e199692d15cf741c0e29ae28f25c52 (patch)
tree3cfe20ce434b986e58efbc9bececcda41502ed33 /test/lv2.cc
parent19ac4649f16621430b7d34635410fd67fd8ef49e (diff)
Make use of uUnit as a submodule (dgunit renamed).
Diffstat (limited to 'test/lv2.cc')
-rw-r--r--test/lv2.cc76
1 files changed, 38 insertions, 38 deletions
diff --git a/test/lv2.cc b/test/lv2.cc
index 0c86ad2..837117e 100644
--- a/test/lv2.cc
+++ b/test/lv2.cc
@@ -24,7 +24,7 @@
* along with DrumGizmo; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "dgunit.h"
+#include <uunit.h>
#include <config.h>
@@ -56,15 +56,15 @@ enum class Ports {
* - Run with buffer size a prime number (and thereby not power of 2)
* - Run with HUGE number of midi events in one buffer (10000)
*/
-class test_lv2 : public DGUnit
+class test_lv2 : public uUnit
{
public:
test_lv2()
{
- DGUNIT_TEST(test_lv2::open_and_verify);
- DGUNIT_TEST(test_lv2::run_no_ports_connected);
- DGUNIT_TEST(test_lv2::run_no_output_ports_connected);
- DGUNIT_TEST(test_lv2::test1);
+ uUNIT_TEST(test_lv2::open_and_verify);
+ uUNIT_TEST(test_lv2::run_no_ports_connected);
+ uUNIT_TEST(test_lv2::run_no_output_ports_connected);
+ uUNIT_TEST(test_lv2::test1);
}
DrumkitCreator drumkit_creator;
@@ -76,13 +76,13 @@ public:
LV2TestHost h(LV2_PATH);
res = h.open(DG_URI);
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
res = h.verify();
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
res = h.close();
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
}
void run_no_ports_connected()
@@ -92,13 +92,13 @@ public:
LV2TestHost h(LV2_PATH);
res = h.open(DG_URI);
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
res = h.verify();
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
res = h.createInstance(44100);
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
const char config_fmt[] =
"<config>\n"
@@ -167,21 +167,21 @@ public:
latency_regain);
res = h.loadConfig(config, strlen(config));
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
// run for 1 samples to trigger kit loading
res = h.run(1);
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // wait for kit to get loaded (async),
res = h.run(100);
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
res = h.destroyInstance();
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
res = h.close();
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
}
void run_no_output_ports_connected()
@@ -191,13 +191,13 @@ public:
LV2TestHost h(LV2_PATH);
res = h.open(DG_URI);
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
res = h.verify();
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
res = h.createInstance(44100);
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
const char config_fmt[] =
"<config>\n"
@@ -266,7 +266,7 @@ public:
latency_regain);
res = h.loadConfig(config, strlen(config));
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
// Port buffers:
char sequence_buffer[4096];
@@ -277,22 +277,22 @@ public:
LV2TestHost::Sequence seq(sequence_buffer, sizeof(sequence_buffer));
res = h.connectPort((int)Ports::MidiPort, seq.data());
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
// run for 1 samples to trigger kit loading
res = h.run(1);
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // wait for kit to get loaded (async),
seq.addMidiNote(5, 1, 127);
res = h.run(100);
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
res = h.destroyInstance();
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
res = h.close();
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
}
void test1()
@@ -302,13 +302,13 @@ public:
LV2TestHost h(LV2_PATH);
res = h.open(DG_URI);
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
res = h.verify();
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
res = h.createInstance(44100);
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
const char config_fmt[] =
"<config>\n"
@@ -377,7 +377,7 @@ public:
latency_regain);
res = h.loadConfig(config, strlen(config));
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
// Port buffers:
char sequence_buffer[4096];
@@ -389,7 +389,7 @@ public:
LV2TestHost::Sequence seq(sequence_buffer, sizeof(sequence_buffer));
res = h.connectPort((int)Ports::MidiPort, seq.data());
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
for(int i = 0; i < NUM_CHANNELS; ++i)
{
@@ -399,11 +399,11 @@ public:
}
res += h.connectPort((int)Ports::AudioPortOffset + i, pcm_buffer[i]);
}
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
// run for 1 samples to trigger kit loading
res = h.run(1);
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
std::this_thread::sleep_for(std::chrono::seconds(1)); // wait for kit to get loaded (async),
seq.addMidiNote(5, 1, 127);
@@ -411,7 +411,7 @@ public:
{
res = h.run(10);
std::this_thread::sleep_for(std::chrono::milliseconds(1));
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
//printf("Iteration:\n");
//for(int k = 0; k < 16; k++) {
@@ -428,7 +428,7 @@ public:
seq.addMidiNote(5, 1, 127);
res = h.run(10);
std::this_thread::sleep_for(std::chrono::milliseconds(1));
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
/*
printf("Iteration:\n");
@@ -451,16 +451,16 @@ public:
{
for(int j = 0; j < 10; j++)
{
- DGUNIT_ASSERT_EQUAL(((j==5)?comp_val.f:0), pcm_buffer[k][j]);
+ uUNIT_ASSERT_EQUAL(((j==5)?comp_val.f:0), pcm_buffer[k][j]);
}
}
seq.clear();
res = h.destroyInstance();
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
res = h.close();
- DGUNIT_ASSERT_EQUAL(0, res);
+ uUNIT_ASSERT_EQUAL(0, res);
}
};