From b8b39106b9c730b3ad53979f035e0af567be59c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Tue, 8 Nov 2022 08:14:32 +0100 Subject: [PATCH 1/2] Fix building with portmidi 2.0.4 --- src/test/portmidicontroller_test.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/test/portmidicontroller_test.cpp b/src/test/portmidicontroller_test.cpp index e625ff57742..bf03f00f415 100644 --- a/src/test/portmidicontroller_test.cpp +++ b/src/test/portmidicontroller_test.cpp @@ -64,14 +64,17 @@ class PortMidiControllerTest : public MixxxTest { PortMidiControllerTest() : m_mockInput(new MockPortMidiDevice(&m_inputDeviceInfo, 0)), m_mockOutput(new MockPortMidiDevice(&m_outputDeviceInfo, 0)) { - m_inputDeviceInfo.name = "Test Input Device"; - m_inputDeviceInfo.interf = "Test"; + char inputDeviceName[] = "Test Input Device"; + char outputDeviceName[] = "Test Output Device"; + char interf[] = "Test"; + m_inputDeviceInfo.name = inputDeviceName; + m_inputDeviceInfo.interf = interf; m_inputDeviceInfo.input = 1; m_inputDeviceInfo.output = 0; m_inputDeviceInfo.opened = 0; - m_outputDeviceInfo.name = "Test Output Device"; - m_outputDeviceInfo.interf = "Test"; + m_outputDeviceInfo.name = outputDeviceName; + m_outputDeviceInfo.interf = interf; m_outputDeviceInfo.input = 0; m_outputDeviceInfo.output = 1; m_outputDeviceInfo.opened = 0; From b3faa7a54986e2142bc7eb98c241ccbdc04ad896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Wed, 9 Nov 2022 07:37:00 +0100 Subject: [PATCH 2/2] Explain why name is non const --- src/test/portmidicontroller_test.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/portmidicontroller_test.cpp b/src/test/portmidicontroller_test.cpp index bf03f00f415..0c2df08721e 100644 --- a/src/test/portmidicontroller_test.cpp +++ b/src/test/portmidicontroller_test.cpp @@ -64,9 +64,11 @@ class PortMidiControllerTest : public MixxxTest { PortMidiControllerTest() : m_mockInput(new MockPortMidiDevice(&m_inputDeviceInfo, 0)), m_mockOutput(new MockPortMidiDevice(&m_outputDeviceInfo, 0)) { + // PmDeviceInfo::name is non const since portmidi 2.0.1 + // We maintain the memory here in place of Pm_GetDeviceInfo() char inputDeviceName[] = "Test Input Device"; char outputDeviceName[] = "Test Output Device"; - char interf[] = "Test"; + constexpr const char interf[] = "Test"; m_inputDeviceInfo.name = inputDeviceName; m_inputDeviceInfo.interf = interf; m_inputDeviceInfo.input = 1;