I used to unit-test some of my code by creating a fake MidiInput like this:
class CustomMidiInput : public juce::MidiInput
{
public:
CustomMidiInput()
: juce::MidiInput("Fake Device")
{
/// Tricking JUCE to avoid errors at delete time for a non-existing device
internal = nullptr;
}
};
My unit-test would then attach properties to this device and check that everything is correctly saved, etc.
But since the constructor for MidiInput has become private, I can't use this trick anymore. What do you guys suggest as a work-around? I could try to open the default midi input and change its name to "Fake Device" to go on with my tests, but then it would fail on a continuous integration server that usually has 0 midi input devices available...