Atlas - testautomation_joystick.c
Home / ext / SDL / test Lines: 1 | Size: 18750 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1/** 2 * Joystick test suite 3 */ 4 5#include <SDL3/SDL.h> 6#include <SDL3/SDL_test.h> 7#include "../src/joystick/usb_ids.h" 8#include "testautomation_suites.h" 9 10/* ================= Test Case Implementation ================== */ 11 12/* Fixture */ 13 14/* Create a 32-bit writable surface for blitting tests */ 15static void SDLCALL joystickSetUp(void **arg) 16{ 17 SDL_InitSubSystem(SDL_INIT_GAMEPAD); 18 19 SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); 20} 21 22static void SDLCALL joystickTearDown(void *arg) 23{ 24 SDL_ResetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS); 25 26 SDL_QuitSubSystem(SDL_INIT_GAMEPAD); 27} 28 29 30/* Test case functions */ 31 32/** 33 * Check virtual joystick creation 34 * 35 * \sa SDL_AttachVirtualJoystick 36 */ 37static int SDLCALL joystick_testVirtual(void *arg) 38{ 39 SDL_VirtualJoystickDesc desc; 40 SDL_Joystick *joystick = NULL; 41 SDL_Gamepad *gamepad = NULL; 42 SDL_JoystickID device_id; 43 44 SDL_INIT_INTERFACE(&desc); 45 desc.type = SDL_JOYSTICK_TYPE_GAMEPAD; 46 desc.naxes = SDL_GAMEPAD_AXIS_COUNT; 47 desc.nbuttons = SDL_GAMEPAD_BUTTON_COUNT; 48 desc.vendor_id = USB_VENDOR_NVIDIA; 49 desc.product_id = USB_PRODUCT_NVIDIA_SHIELD_CONTROLLER_V103; 50 desc.name = "Virtual NVIDIA SHIELD Controller"; 51 device_id = SDL_AttachVirtualJoystick(&desc); 52 SDLTest_AssertCheck(device_id > 0, "SDL_AttachVirtualJoystick() -> %" SDL_PRIs32 " (expected > 0)", device_id); 53 SDLTest_AssertCheck(SDL_IsJoystickVirtual(device_id), "SDL_IsJoystickVirtual()"); 54 if (device_id > 0) { 55 joystick = SDL_OpenJoystick(device_id); 56 SDLTest_AssertCheck(joystick != NULL, "SDL_OpenJoystick()"); 57 if (joystick) { 58 { 59 const char *dname = SDL_GetJoystickName(joystick); 60 SDLTest_AssertCheck(SDL_strcmp(dname, desc.name) == 0, "SDL_GetJoystickName() -> \"%s\" (expected \"%s\")", dname, desc.name); 61 } 62 { 63 Uint16 vendor_id = SDL_GetJoystickVendor(joystick); 64 SDLTest_AssertCheck(vendor_id == desc.vendor_id, "SDL_GetJoystickVendor() -> 0x%04x (expected 0x%04x)", vendor_id, desc.vendor_id); 65 } 66 { 67 Uint16 product_id = SDL_GetJoystickProduct(joystick); 68 SDLTest_AssertCheck(product_id == desc.product_id, "SDL_GetJoystickProduct() -> 0x%04x (expected 0x%04x)", product_id, desc.product_id); 69 } 70 { 71 Uint16 product_version = SDL_GetJoystickProductVersion(joystick); 72 SDLTest_AssertCheck(product_version == 0, "SDL_GetJoystickProductVersion() -> 0x%04x (expected 0x%04x)", product_version, 0); 73 } 74 { 75 Uint16 firmware_Version = SDL_GetJoystickFirmwareVersion(joystick); 76 SDLTest_AssertCheck(firmware_Version == 0, "SDL_GetJoystickFirmwareVersion() -> 0x%04x (expected 0x%04x)", firmware_Version, 0); 77 } 78 { 79 const char *serial = SDL_GetJoystickSerial(joystick); 80 SDLTest_AssertCheck(serial == NULL, "SDL_GetJoystickSerial() -> %s (expected %s)", serial, "(null)"); 81 } 82 { 83 SDL_JoystickType type = SDL_GetJoystickType(joystick); 84 SDLTest_AssertCheck(type == desc.type, "SDL_GetJoystickType() -> %d (expected %d)", type, desc.type); 85 } 86 { 87 Uint16 naxes = SDL_GetNumJoystickAxes(joystick); 88 SDLTest_AssertCheck(naxes == desc.naxes, "SDL_GetNumJoystickAxes() -> 0x%04x (expected 0x%04x)", naxes, desc.naxes); 89 } 90 { 91 int nballs = SDL_GetNumJoystickBalls(joystick); 92 SDLTest_AssertCheck(nballs == 0, "SDL_GetNumJoystickBalls() -> %d (expected %d)", nballs, 0); 93 } 94 { 95 int nhats = SDL_GetNumJoystickHats(joystick); 96 SDLTest_AssertCheck(nhats == desc.nhats, "SDL_GetNumJoystickHats() -> %d (expected %d)", nhats, desc.nhats); 97 } 98 { 99 int nbuttons = SDL_GetNumJoystickButtons(joystick); 100 SDLTest_AssertCheck(nbuttons == desc.nbuttons, "SDL_GetNumJoystickButtons() -> %d (expected %d)", nbuttons, desc.nbuttons); 101 } 102 103 SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, true), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, true)"); 104 SDL_UpdateJoysticks(); 105 SDLTest_AssertCheck(SDL_GetJoystickButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH) == true, "SDL_GetJoystickButton(SDL_GAMEPAD_BUTTON_SOUTH) == true"); 106 107 SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, false), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, false)"); 108 SDL_UpdateJoysticks(); 109 SDLTest_AssertCheck(SDL_GetJoystickButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH) == false, "SDL_GetJoystickButton(SDL_GAMEPAD_BUTTON_SOUTH) == false"); 110 111 gamepad = SDL_OpenGamepad(SDL_GetJoystickID(joystick)); 112 SDLTest_AssertCheck(gamepad != NULL, "SDL_OpenGamepad() succeeded"); 113 if (gamepad) { 114 { 115 const char *name = SDL_GetGamepadName(gamepad); 116 SDLTest_AssertCheck(name && SDL_strcmp(name, desc.name) == 0, "SDL_GetGamepadName() -> \"%s\" (expected \"%s\")", name, desc.name); 117 } 118 { 119 Uint16 vendor_id = SDL_GetGamepadVendor(gamepad); 120 SDLTest_AssertCheck(vendor_id == desc.vendor_id, "SDL_GetGamepadVendor() -> 0x%04x (expected 0x%04x)", vendor_id, desc.vendor_id); 121 } 122 { 123 Uint16 product_id = SDL_GetGamepadProduct(gamepad); 124 SDLTest_AssertCheck(product_id == desc.product_id, "SDL_GetGamepadProduct() -> 0x%04x (expected 0x%04x)", product_id, desc.product_id); 125 } 126 127 /* Set an explicit mapping with a different name */ 128 SDL_SetGamepadMapping(SDL_GetJoystickID(joystick), "ff008316550900001072000000007601,Virtual Gamepad,a:b0,b:b1,x:b2,y:b3,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,"); 129 { 130 const char *name = SDL_GetGamepadName(gamepad); 131 SDLTest_AssertCheck(name && SDL_strcmp(name, "Virtual Gamepad") == 0, "SDL_GetGamepadName() ->\"%s\" (expected \"%s\")", name, "Virtual Gamepad"); 132 } 133 { 134 SDL_GamepadButtonLabel label = SDL_GetGamepadButtonLabel(gamepad, SDL_GAMEPAD_BUTTON_SOUTH); 135 SDLTest_AssertCheck(label == SDL_GAMEPAD_BUTTON_LABEL_A, "SDL_GetGamepadButtonLabel(SDL_GAMEPAD_BUTTON_SOUTH) -> %d (expected %d [%s])", 136 label, SDL_GAMEPAD_BUTTON_LABEL_A, "SDL_GAMEPAD_BUTTON_LABEL_A"); 137 } 138 SDLTest_AssertCheck(SDL_GetGamepadButtonLabel(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_A, "SDL_GetGamepadButtonLabel(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_A"); 139 140 /* Set the south button and verify that the gamepad responds */ 141 SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, true), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, true)"); 142 SDL_UpdateJoysticks(); 143 SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == true, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == true"); 144 145 SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, false), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, false)"); 146 SDL_UpdateJoysticks(); 147 SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == false, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == false"); 148 149 /* Set an explicit mapping with legacy GameCube style buttons */ 150 SDL_SetGamepadMapping(SDL_GetJoystickID(joystick), "ff008316550900001072000000007601,Virtual Nintendo GameCube,a:b0,b:b1,x:b2,y:b3,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,hint:SDL_GAMECONTROLLER_USE_GAMECUBE_LABELS:=1,"); 151 { 152 const char *name = SDL_GetGamepadName(gamepad); 153 SDLTest_AssertCheck(name && SDL_strcmp(name, "Virtual Nintendo GameCube") == 0, "SDL_GetGamepadName() -> \"%s\" (expected \"%s\")", name, "Virtual Nintendo GameCube"); 154 } 155 SDLTest_AssertCheck(SDL_GetGamepadButtonLabel(gamepad, SDL_GAMEPAD_BUTTON_EAST) == SDL_GAMEPAD_BUTTON_LABEL_X, "SDL_GetGamepadButtonLabel(SDL_GAMEPAD_BUTTON_EAST) == SDL_GAMEPAD_BUTTON_LABEL_X"); 156 157 /* Set the east button and verify that the gamepad responds, mapping "B" to the west button */ 158 SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_EAST, true), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_EAST, true)"); 159 SDL_UpdateJoysticks(); 160 SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_WEST) == true, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_WEST) == true"); 161 162 SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_EAST, false), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_EAST, false)"); 163 SDL_UpdateJoysticks(); 164 SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_WEST) == false, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_WEST) == false"); 165 166 /* Set an explicit mapping with legacy Nintendo style buttons */ 167 SDL_SetGamepadMapping(SDL_GetJoystickID(joystick), "ff008316550900001072000000007601,Virtual Nintendo Gamepad,a:b1,b:b0,x:b3,y:b2,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,"); 168 { 169 const char *name = SDL_GetGamepadName(gamepad); 170 SDLTest_AssertCheck(name && SDL_strcmp(name, "Virtual Nintendo Gamepad") == 0, "SDL_GetGamepadName() -> \"%s\" (expected \"%s\")", name, "Virtual Nintendo Gamepad"); 171 } 172 SDLTest_AssertCheck(SDL_GetGamepadButtonLabel(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_B, "SDL_GetGamepadButtonLabel(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_B"); 173 174 /* Set the south button and verify that the gamepad responds */ 175 SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, true), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, true)"); 176 SDL_UpdateJoysticks(); 177 SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == true, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == true"); 178 179 SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, false), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, false)"); 180 SDL_UpdateJoysticks(); 181 SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == false, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == false"); 182 183 /* Set an explicit mapping with PS4 style buttons */ 184 SDL_SetGamepadMapping(SDL_GetJoystickID(joystick), "ff008316550900001072000000007601,Virtual PS4 Gamepad,type:ps4,a:b0,b:b1,x:b2,y:b3,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,"); 185 { 186 const char *name = SDL_GetGamepadName(gamepad); 187 SDLTest_AssertCheck(SDL_strcmp(name, "Virtual PS4 Gamepad") == 0, "SDL_GetGamepadName() -> \"%s\" (expected \"%s\")", name, "Virtual PS4 Gamepad"); 188 } 189 SDLTest_AssertCheck(SDL_GetGamepadButtonLabel(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_CROSS, "SDL_GetGamepadButtonLabel(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_CROSS"); 190 191 /* Set the south button and verify that the gamepad responds */ 192 SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, true), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, true)"); 193 SDL_UpdateJoysticks(); 194 SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == true, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == true"); 195 196 SDLTest_AssertCheck(SDL_SetJoystickVirtualButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH, false), "SDL_SetJoystickVirtualButton(SDL_GAMEPAD_BUTTON_SOUTH, false)"); 197 SDL_UpdateJoysticks(); 198 SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == false, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == false"); 199 200 SDL_CloseGamepad(gamepad); 201 } 202 203 SDL_CloseJoystick(joystick); 204 } 205 SDLTest_AssertCheck(SDL_DetachVirtualJoystick(device_id), "SDL_DetachVirtualJoystick()"); 206 } 207 SDLTest_AssertCheck(!SDL_IsJoystickVirtual(device_id), "!SDL_IsJoystickVirtual()"); 208 209 return TEST_COMPLETED; 210} 211 212/** 213 * Check gamepad mappings 214 */ 215static int SDLCALL joystick_testMappings(void *arg) 216{ 217 SDL_VirtualJoystickDesc desc; 218 SDL_Gamepad *gamepad = NULL; 219 SDL_JoystickID device_id; 220 221 /* Add a mapping for the virtual controller in advance */ 222 SDL_AddGamepadMapping("ff000000550900001472000000007601,Virtual Gamepad,a:b0,b:b1,x:b2,y:b3,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,"); 223 224 SDL_INIT_INTERFACE(&desc); 225 desc.type = SDL_JOYSTICK_TYPE_GAMEPAD; 226 desc.naxes = SDL_GAMEPAD_AXIS_COUNT; 227 desc.nbuttons = SDL_GAMEPAD_BUTTON_COUNT; 228 desc.vendor_id = USB_VENDOR_NVIDIA; 229 desc.product_id = USB_PRODUCT_NVIDIA_SHIELD_CONTROLLER_V104; 230 desc.name = "Virtual NVIDIA SHIELD Controller"; 231 device_id = SDL_AttachVirtualJoystick(&desc); 232 SDLTest_AssertCheck(device_id > 0, "SDL_AttachVirtualJoystick() -> %" SDL_PRIs32 " (expected > 0)", device_id); 233 SDLTest_AssertCheck(SDL_IsJoystickVirtual(device_id), "SDL_IsJoystickVirtual()"); 234 235 gamepad = SDL_OpenGamepad(device_id); 236 SDLTest_AssertCheck(gamepad != NULL, "SDL_OpenGamepad() succeeded"); 237 if (gamepad) { 238 /* Verify that the gamepad picked up the predefined mapping */ 239 { 240 const char *name = SDL_GetGamepadName(gamepad); 241 SDLTest_AssertCheck(name && SDL_strcmp(name, "Virtual Gamepad") == 0, "SDL_GetGamepadName() ->\"%s\" (expected \"%s\")", name, "Virtual Gamepad"); 242 } 243 244 /* Verify that the gamepad picks up a new mapping with no CRC */ 245 SDL_AddGamepadMapping("ff000000550900001472000000007601,Virtual Gamepad V2,a:b0,b:b1,x:b2,y:b3,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,"); 246 { 247 const char *name = SDL_GetGamepadName(gamepad); 248 SDLTest_AssertCheck(name && SDL_strcmp(name, "Virtual Gamepad V2") == 0, "SDL_GetGamepadName() ->\"%s\" (expected \"%s\")", name, "Virtual Gamepad V2"); 249 } 250 251 /* Verify that the gamepad picks up a new mapping with valid CRC */ 252 SDL_AddGamepadMapping("ff008316550900001472000000007601,Virtual Gamepad V3,a:b0,b:b1,x:b2,y:b3,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,"); 253 { 254 const char *name = SDL_GetGamepadName(gamepad); 255 SDLTest_AssertCheck(name && SDL_strcmp(name, "Virtual Gamepad V3") == 0, "SDL_GetGamepadName() ->\"%s\" (expected \"%s\")", name, "Virtual Gamepad V3"); 256 } 257 258 SDL_CloseGamepad(gamepad); 259 } 260 SDLTest_AssertCheck(SDL_DetachVirtualJoystick(device_id), "SDL_DetachVirtualJoystick()"); 261 262 /* Try matching mappings with a new CRC */ 263 desc.name = "Virtual NVIDIA SHIELD Controller V2"; 264 device_id = SDL_AttachVirtualJoystick(&desc); 265 SDLTest_AssertCheck(device_id > 0, "SDL_AttachVirtualJoystick() -> %" SDL_PRIs32 " (expected > 0)", device_id); 266 SDLTest_AssertCheck(SDL_IsJoystickVirtual(device_id), "SDL_IsJoystickVirtual()"); 267 268 gamepad = SDL_OpenGamepad(device_id); 269 SDLTest_AssertCheck(gamepad != NULL, "SDL_OpenGamepad() succeeded"); 270 if (gamepad) { 271 { 272 const char *name = SDL_GetGamepadName(gamepad); 273 SDLTest_AssertCheck(name && SDL_strcmp(name, "Virtual Gamepad V2") == 0, "SDL_GetGamepadName() ->\"%s\" (expected \"%s\")", name, "Virtual Gamepad V2"); 274 } 275 SDL_CloseGamepad(gamepad); 276 } 277 SDLTest_AssertCheck(SDL_DetachVirtualJoystick(device_id), "SDL_DetachVirtualJoystick()"); 278 279 return TEST_COMPLETED; 280} 281 282/* ================= Test References ================== */ 283 284/* Joystick routine test cases */ 285static const SDLTest_TestCaseReference joystickTest1 = { 286 joystick_testVirtual, "joystick_testVirtual", "Test virtual joystick functionality", TEST_ENABLED 287}; 288static const SDLTest_TestCaseReference joystickTest2 = { 289 joystick_testMappings, "joystick_testMappings", "Test gamepad mapping functionality", TEST_ENABLED 290}; 291 292/* Sequence of Joystick routine test cases */ 293static const SDLTest_TestCaseReference *joystickTests[] = { 294 &joystickTest1, 295 &joystickTest2, 296 NULL 297}; 298 299/* Joystick routine test suite (global) */ 300SDLTest_TestSuiteReference joystickTestSuite = { 301 "Joystick", 302 joystickSetUp, 303 joystickTests, 304 joystickTearDown 305}; 306[FILE END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.