|
6 | 6 | #include <SDL3/SDL_test.h> |
7 | 7 | #include "../src/joystick/usb_ids.h" |
8 | 8 | #include "testautomation_suites.h" |
| 9 | +#ifdef HAVE_BUILD_CONFIG |
| 10 | +#include "SDL_build_config.h" |
| 11 | +#endif |
9 | 12 |
|
10 | 13 | /* ================= Test Case Implementation ================== */ |
11 | 14 |
|
@@ -36,6 +39,10 @@ static void SDLCALL joystickTearDown(void *arg) |
36 | 39 | */ |
37 | 40 | static int SDLCALL joystick_testVirtual(void *arg) |
38 | 41 | { |
| 42 | +#ifndef SDL_JOYSTICK_VIRTUAL |
| 43 | + SDLTest_AssertPass("The joystick_testVirtual test requires SDL_JOYSTICK_VIRTUAL to be defined"); |
| 44 | + return TEST_SKIPPED; |
| 45 | +#else |
39 | 46 | SDL_VirtualJoystickDesc desc; |
40 | 47 | SDL_Joystick *joystick = NULL; |
41 | 48 | SDL_Gamepad *gamepad = NULL; |
@@ -207,13 +214,18 @@ static int SDLCALL joystick_testVirtual(void *arg) |
207 | 214 | SDLTest_AssertCheck(!SDL_IsJoystickVirtual(device_id), "!SDL_IsJoystickVirtual()"); |
208 | 215 |
|
209 | 216 | return TEST_COMPLETED; |
| 217 | +#endif // SDL_JOYSTICK_VIRTUAL |
210 | 218 | } |
211 | 219 |
|
212 | 220 | /** |
213 | 221 | * Check gamepad mappings |
214 | 222 | */ |
215 | 223 | static int SDLCALL joystick_testMappings(void *arg) |
216 | 224 | { |
| 225 | +#ifndef SDL_JOYSTICK_VIRTUAL |
| 226 | + SDLTest_AssertPass("The joystick_testMappings test requires SDL_JOYSTICK_VIRTUAL to be defined"); |
| 227 | + return TEST_SKIPPED; |
| 228 | +#else |
217 | 229 | SDL_VirtualJoystickDesc desc; |
218 | 230 | SDL_Gamepad *gamepad = NULL; |
219 | 231 | SDL_JoystickID device_id; |
@@ -277,6 +289,7 @@ static int SDLCALL joystick_testMappings(void *arg) |
277 | 289 | SDLTest_AssertCheck(SDL_DetachVirtualJoystick(device_id), "SDL_DetachVirtualJoystick()"); |
278 | 290 |
|
279 | 291 | return TEST_COMPLETED; |
| 292 | +#endif // SDL_JOYSTICK_VIRTUAL |
280 | 293 | } |
281 | 294 |
|
282 | 295 | /* ================= Test References ================== */ |
|
0 commit comments