Skip to content

Commit

Permalink
Add ProgramChanger test
Browse files Browse the repository at this point in the history
  • Loading branch information
tttapa committed Dec 2, 2023
1 parent 39d1ab5 commit 6a65a8d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
18 changes: 18 additions & 0 deletions test/MIDI_Outputs/test-ProgramChanger.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <Banks/Bank.hpp>
#include <MIDI_Outputs/ProgramChanger.hpp>
#include <MockMIDI_Interface.hpp>
#include <gmock/gmock.h>

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);
}

0 comments on commit 6a65a8d

Please sign in to comment.