diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index cd4e13c509..ab0447a873 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -43,6 +43,7 @@ add_executable(tests "MIDI_Outputs/test-NoteButton.cpp" "MIDI_Outputs/test-Construction.cpp" "MIDI_Outputs/test-CCRotaryEncoder.cpp" + "MIDI_Outputs/test-ProgramChanger.cpp" "MIDI_Interfaces/test-DebugStreamMIDI_Interface.cpp" "MIDI_Interfaces/test-USBMIDI_Interface.cpp" "MIDI_Interfaces/test-StreamMIDI_Interface.cpp" diff --git a/test/MIDI_Outputs/test-ProgramChanger.cpp b/test/MIDI_Outputs/test-ProgramChanger.cpp new file mode 100644 index 0000000000..f7bb5d2bd2 --- /dev/null +++ b/test/MIDI_Outputs/test-ProgramChanger.cpp @@ -0,0 +1,18 @@ +#include +#include +#include +#include + +using namespace ::testing; +using namespace cs; + +TEST(ProgramChanger, select) { + MockMIDI_Interface midi; + Control_Surface.connectDefaultMIDI_Interface(); + + ProgramChanger<5> pc {{1, 2, 3, 4, 5}, {Channel_3, Cable_13}}; + + EXPECT_CALL(midi, sendChannelMessageImpl( + ChannelMessage(0xC2, 0x2, 0x00, Cable_13))); + pc.select(1); +}