automation_main.c: fix -Wformat-zero-length warning due to SDL_SetError("")
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 8b2738a..133c797 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 3.0)
project(SDL2_test)
+include(CheckCCompilerFlag)
+include(CMakePushCheckState)
+
if(NOT TARGET SDL2::SDL2-static)
find_package(SDL2 2.0.23 REQUIRED COMPONENTS SDL2-static SDL2test)
endif()
@@ -79,7 +82,6 @@ add_executable(testaudioinfo testaudioinfo.c)
file(GLOB TESTAUTOMATION_SOURCE_FILES testautomation*.c)
add_executable(testautomation ${TESTAUTOMATION_SOURCE_FILES})
-
add_executable(testmultiaudio testmultiaudio.c testutils.c)
add_executable(testaudiohotplug testaudiohotplug.c testutils.c)
add_executable(testaudiocapture testaudiocapture.c)
diff --git a/test/testautomation_main.c b/test/testautomation_main.c
index f267789..97d2352 100644
--- a/test/testautomation_main.c
+++ b/test/testautomation_main.c
@@ -125,6 +125,11 @@ static int main_testImpliedJoystickQuit (void *arg)
#endif
}
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-zero-length"
+#endif
+
static int
main_testSetError(void *arg)
{
@@ -145,6 +150,10 @@ main_testSetError(void *arg)
return TEST_COMPLETED;
}
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+
static const SDLTest_TestCaseReference mainTest1 =
{ (SDLTest_TestCaseFp)main_testInitQuitJoystickHaptic, "main_testInitQuitJoystickHaptic", "Tests SDL_Init/Quit of Joystick and Haptic subsystem", TEST_ENABLED};