3
3
#include < catch2/catch_test_macros.hpp>
4
4
#include < catch2/matchers/catch_matchers_string.hpp>
5
5
6
- TEST_CASE (" one is equal to one" , " [dummy]" )
7
- {
8
- REQUIRE (1 == 1 );
9
- }
10
-
11
6
TEST_CASE (" Plugin instance" , " [instance]" )
12
7
{
13
8
PluginProcessor testPlugin;
@@ -20,10 +15,48 @@ TEST_CASE ("Plugin instance", "[instance]")
20
15
SECTION (" name" )
21
16
{
22
17
CHECK_THAT (testPlugin.getName ().toStdString (),
23
- Catch::Matchers::Equals (" Pamplejuce Demo " ));
18
+ Catch::Matchers::Equals (" BirdHouse " ));
24
19
}
25
- }
26
20
21
+ auto numOSCChannels = testPlugin.numOSCChannels ();
22
+ SECTION (" number of OSC channels" )
23
+ {
24
+ CHECK (numOSCChannels == 8 );
25
+ }
26
+
27
+ SECTION (" OSC channel" )
28
+ {
29
+ auto & channel = testPlugin.getChannel (0 );
30
+
31
+ // Set path
32
+ channel.get ()->state ().setPath (" /1/value" );
33
+ CHECK (channel.get ()->state ().path () == " /1/value" );
34
+
35
+ // Set inMin
36
+ channel.get ()->state ().setInputMin (0 .0f );
37
+ CHECK (channel.get ()->state ().inMin () == 0 .0f );
38
+
39
+ // Set inMax
40
+ channel.get ()->state ().setInputMax (1 .0f );
41
+ CHECK (channel.get ()->state ().inMax () == 1 .0f );
42
+
43
+ // Set midiChan
44
+ channel.get ()->state ().setOutputMidiChannel (1 );
45
+ CHECK (channel.get ()->state ().outChan () == 1 );
46
+
47
+ // Set midiNum
48
+ channel.get ()->state ().setOutputMidiNum (1 );
49
+ CHECK (channel.get ()->state ().outNum () == 1 );
50
+
51
+ // Set msgType
52
+ channel.get ()->state ().setOutputType (static_cast <birdhouse::MsgType> (1 ));
53
+ CHECK (channel.get ()->state ().outType () == 1 );
54
+
55
+ // Set muted
56
+ channel.get ()->state ().setMuted (false );
57
+ CHECK_FALSE (channel.get ()->state ().muted ());
58
+ }
59
+ }
27
60
28
61
#ifdef PAMPLEJUCE_IPP
29
62
#include < ipp.h>
0 commit comments