From 6a65a8decab83c653bc57a33fe0716e25c1ef486 Mon Sep 17 00:00:00 2001 From: Pieter Pas Date: Sat, 2 Dec 2023 23:38:00 +0100 Subject: [PATCH] Add ProgramChanger test --- test/CMakeLists.txt | 1 + test/MIDI_Outputs/test-ProgramChanger.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 test/MIDI_Outputs/test-ProgramChanger.cpp 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); +}