SDL: testcontroller replaces gamepadmap

From 505a8dfb15694c78b3266a3b0426c5db3147c805 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 16 Jul 2023 01:00:38 -0700
Subject: [PATCH] testcontroller replaces gamepadmap

---
 VisualC/SDL.sln                             |  20 -
 VisualC/tests/gamepadmap/gamepadmap.vcxproj | 206 -----
 test/CMakeLists.txt                         |   1 -
 test/gamepadmap.c                           | 822 --------------------
 4 files changed, 1049 deletions(-)
 delete mode 100644 VisualC/tests/gamepadmap/gamepadmap.vcxproj
 delete mode 100644 test/gamepadmap.c

diff --git a/VisualC/SDL.sln b/VisualC/SDL.sln
index 66403e16ff65..ff6a2b463bb7 100644
--- a/VisualC/SDL.sln
+++ b/VisualC/SDL.sln
@@ -40,8 +40,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testcontroller", "tests\tes
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgles2", "tests\testgles2\testgles2.vcxproj", "{E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gamepadmap", "tests\gamepadmap\gamepadmap.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08306}"
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testvulkan", "tests\testvulkan\testvulkan.vcxproj", "{0D604DFD-AAB6-442C-9368-F91A344146AB}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testwm", "tests\testwm\testwm.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A5}"
@@ -124,14 +122,6 @@ Global
 		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32
 		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|x64
 		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08304}.Debug|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08304}.Debug|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08304}.Release|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08304}.Release|x64.Build.0 = Release|x64
 		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|Win32.ActiveCfg = Debug|Win32
 		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|Win32.Build.0 = Debug|Win32
 		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A}.Debug|x64.ActiveCfg = Debug|x64
@@ -220,14 +210,6 @@ Global
 		{E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|Win32.Build.0 = Release|Win32
 		{E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|x64.ActiveCfg = Release|x64
 		{E9558DFE-1961-4DD4-B09B-DD0EEFD5C315}.Release|x64.Build.0 = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08306}.Debug|Win32.ActiveCfg = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08306}.Debug|Win32.Build.0 = Debug|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08306}.Debug|x64.ActiveCfg = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08306}.Debug|x64.Build.0 = Debug|x64
-		{55812185-D13C-4022-9C81-32E0F4A08306}.Release|Win32.ActiveCfg = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08306}.Release|Win32.Build.0 = Release|Win32
-		{55812185-D13C-4022-9C81-32E0F4A08306}.Release|x64.ActiveCfg = Release|x64
-		{55812185-D13C-4022-9C81-32E0F4A08306}.Release|x64.Build.0 = Release|x64
 		{0D604DFD-AAB6-442C-9368-F91A344146AB}.Debug|Win32.ActiveCfg = Debug|Win32
 		{0D604DFD-AAB6-442C-9368-F91A344146AB}.Debug|Win32.Build.0 = Debug|Win32
 		{0D604DFD-AAB6-442C-9368-F91A344146AB}.Debug|x64.ActiveCfg = Debug|x64
@@ -280,7 +262,6 @@ Global
 		{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
 		{CAE4F1D0-314F-4B10-805B-0EFD670133A0} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
 		{8B5CFB38-CCBA-40A8-AD7A-89C57B070884} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
-		{55812185-D13C-4022-9C81-32E0F4A08304} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
 		{B51E0D74-F0A2-45A2-BD2A-8B7D95B8204A} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
 		{26932B24-EFC6-4E3A-B277-ED653DA37968} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
 		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
@@ -291,7 +272,6 @@ Global
 		{40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
 		{55812185-D13C-4022-9C81-32E0F4A08305} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
 		{E9558DFE-1961-4DD4-B09B-DD0EEFD5C315} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
-		{55812185-D13C-4022-9C81-32E0F4A08306} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
 		{0D604DFD-AAB6-442C-9368-F91A344146AB} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
 		{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A5} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
 		{40FB7794-D3C3-4CFE-BCF4-A80C97635682} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
diff --git a/VisualC/tests/gamepadmap/gamepadmap.vcxproj b/VisualC/tests/gamepadmap/gamepadmap.vcxproj
deleted file mode 100644
index d40bd05f285d..000000000000
--- a/VisualC/tests/gamepadmap/gamepadmap.vcxproj
+++ /dev/null
@@ -1,206 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{55812185-D13C-4022-9C81-32E0F4A08306}</ProjectGuid>
-    <RootNamespace>gamepadmap</RootNamespace>
-    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
-    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
-    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
-    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
-    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
-    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
-    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
-    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
-    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
-    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
-    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
-    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-      <TypeLibraryName>.\Release/gamepadmap.tlb</TypeLibraryName>
-    </Midl>
-    <ClCompile>
-      <AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <WarningLevel>Level3</WarningLevel>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>X64</TargetEnvironment>
-      <TypeLibraryName>.\Release/gamepadmap.tlb</TypeLibraryName>
-    </Midl>
-    <ClCompile>
-      <AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <WarningLevel>Level3</WarningLevel>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>Win32</TargetEnvironment>
-      <TypeLibraryName>.\Debug/gamepadmap.tlb</TypeLibraryName>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MkTypLibCompatible>true</MkTypLibCompatible>
-      <SuppressStartupBanner>true</SuppressStartupBanner>
-      <TargetEnvironment>X64</TargetEnvironment>
-      <TypeLibraryName>.\Debug/gamepadmap.tlb</TypeLibraryName>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>OldStyle</DebugInformationFormat>
-    </ClCompile>
-    <ResourceCompile>
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <Culture>0x0409</Culture>
-    </ResourceCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\SDL\SDL.vcxproj">
-      <Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
-      <Private>false</Private>
-      <CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
-      <ReferenceOutputAssembly>true</ReferenceOutputAssembly>
-    </ProjectReference>
-    <ProjectReference Include="..\..\SDL_test\SDL_test.vcxproj">
-      <Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
-      <Private>false</Private>
-      <CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
-      <ReferenceOutputAssembly>true</ReferenceOutputAssembly>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\..\test\gamepadmap.c" />
-    <ClCompile Include="..\..\..\test\gamepadutils.c" />
-    <ClCompile Include="..\..\..\test\testutils.c" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 77b49f0fd4e4..a6dfdb35f36c 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -257,7 +257,6 @@ add_sdl_test_executable(testdisplayinfo SOURCES testdisplayinfo.c)
 add_sdl_test_executable(testqsort NONINTERACTIVE SOURCES testqsort.c)
 add_sdl_test_executable(testbounds NONINTERACTIVE SOURCES testbounds.c)
 add_sdl_test_executable(testcustomcursor SOURCES testcustomcursor.c)
-add_sdl_test_executable(gamepadmap TESTUTILS SOURCES gamepadmap.c gamepadutils.c)
 add_sdl_test_executable(testvulkan NO_C90 SOURCES testvulkan.c)
 add_sdl_test_executable(testoffscreen SOURCES testoffscreen.c)
 add_sdl_test_executable(testpopup SOURCES testpopup.c)
diff --git a/test/gamepadmap.c b/test/gamepadmap.c
deleted file mode 100644
index 796f9097a021..000000000000
--- a/test/gamepadmap.c
+++ /dev/null
@@ -1,822 +0,0 @@
-/*
-  Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely.
-*/
-
-/* Gamepad mapping generator */
-/* Gabriel Jacobo <gabomdq@gmail.com> */
-
-#include <SDL3/SDL.h>
-#include <SDL3/SDL_main.h>
-#include <SDL3/SDL_test.h>
-
-#include "testutils.h"
-#include "gamepadutils.h"
-
-/* Define this for verbose output while mapping gamepads */
-#define DEBUG_GAMEPADMAP
-
-#define SCREEN_WIDTH  512
-#define SCREEN_HEIGHT 320
-
-enum
-{
-    SDL_GAMEPAD_BINDING_AXIS_LEFTX_NEGATIVE,
-    SDL_GAMEPAD_BINDING_AXIS_LEFTX_POSITIVE,
-    SDL_GAMEPAD_BINDING_AXIS_LEFTY_NEGATIVE,
-    SDL_GAMEPAD_BINDING_AXIS_LEFTY_POSITIVE,
-    SDL_GAMEPAD_BINDING_AXIS_RIGHTX_NEGATIVE,
-    SDL_GAMEPAD_BINDING_AXIS_RIGHTX_POSITIVE,
-    SDL_GAMEPAD_BINDING_AXIS_RIGHTY_NEGATIVE,
-    SDL_GAMEPAD_BINDING_AXIS_RIGHTY_POSITIVE,
-    SDL_GAMEPAD_BINDING_AXIS_TRIGGERLEFT,
-    SDL_GAMEPAD_BINDING_AXIS_TRIGGERRIGHT,
-    SDL_GAMEPAD_BINDING_AXIS_MAX,
-};
-
-#define BINDING_COUNT (SDL_GAMEPAD_BUTTON_MAX + SDL_GAMEPAD_BINDING_AXIS_MAX)
-
-static int s_arrBindingOrder[] = {
-    SDL_GAMEPAD_BUTTON_A,
-    SDL_GAMEPAD_BUTTON_B,
-    SDL_GAMEPAD_BUTTON_Y,
-    SDL_GAMEPAD_BUTTON_X,
-    SDL_GAMEPAD_BUTTON_MAX + SDL_GAMEPAD_BINDING_AXIS_LEFTX_NEGATIVE,
-    SDL_GAMEPAD_BUTTON_MAX + SDL_GAMEPAD_BINDING_AXIS_LEFTX_POSITIVE,
-    SDL_GAMEPAD_BUTTON_MAX + SDL_GAMEPAD_BINDING_AXIS_LEFTY_NEGATIVE,
-    SDL_GAMEPAD_BUTTON_MAX + SDL_GAMEPAD_BINDING_AXIS_LEFTY_POSITIVE,
-    SDL_GAMEPAD_BUTTON_LEFT_STICK,
-    SDL_GAMEPAD_BUTTON_MAX + SDL_GAMEPAD_BINDING_AXIS_RIGHTX_NEGATIVE,
-    SDL_GAMEPAD_BUTTON_MAX + SDL_GAMEPAD_BINDING_AXIS_RIGHTX_POSITIVE,
-    SDL_GAMEPAD_BUTTON_MAX + SDL_GAMEPAD_BINDING_AXIS_RIGHTY_NEGATIVE,
-    SDL_GAMEPAD_BUTTON_MAX + SDL_GAMEPAD_BINDING_AXIS_RIGHTY_POSITIVE,
-    SDL_GAMEPAD_BUTTON_RIGHT_STICK,
-    SDL_GAMEPAD_BUTTON_LEFT_SHOULDER,
-    SDL_GAMEPAD_BUTTON_MAX + SDL_GAMEPAD_BINDING_AXIS_TRIGGERLEFT,
-    SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER,
-    SDL_GAMEPAD_BUTTON_MAX + SDL_GAMEPAD_BINDING_AXIS_TRIGGERRIGHT,
-    SDL_GAMEPAD_BUTTON_DPAD_UP,
-    SDL_GAMEPAD_BUTTON_DPAD_RIGHT,
-    SDL_GAMEPAD_BUTTON_DPAD_DOWN,
-    SDL_GAMEPAD_BUTTON_DPAD_LEFT,
-    SDL_GAMEPAD_BUTTON_BACK,
-    SDL_GAMEPAD_BUTTON_GUIDE,
-    SDL_GAMEPAD_BUTTON_START,
-    SDL_GAMEPAD_BUTTON_MISC1,
-    SDL_GAMEPAD_BUTTON_PADDLE1,
-    SDL_GAMEPAD_BUTTON_PADDLE2,
-    SDL_GAMEPAD_BUTTON_PADDLE3,
-    SDL_GAMEPAD_BUTTON_PADDLE4,
-    SDL_GAMEPAD_BUTTON_TOUCHPAD,
-};
-SDL_COMPILE_TIME_ASSERT(s_arrBindingOrder, SDL_arraysize(s_arrBindingOrder) == BINDING_COUNT);
-
-typedef struct
-{
-    SDL_GamepadBindingType bindType;
-    union
-    {
-        int button;
-
-        struct
-        {
-            int axis;
-            int axis_min;
-            int axis_max;
-        } axis;
-
-        struct
-        {
-            int hat;
-            int hat_mask;
-        } hat;
-
-    } value;
-
-    SDL_bool committed;
-
-} SDL_GameControllerExtendedBind;
-
-static SDL_GameControllerExtendedBind s_arrBindings[BINDING_COUNT];
-
-typedef struct
-{
-    SDL_bool m_bMoving;
-    int m_nLastValue;
-    int m_nStartingValue;
-    int m_nFarthestValue;
-} AxisState;
-
-static int s_nNumAxes;
-static AxisState *s_arrAxisState;
-
-static int s_iCurrentBinding;
-static Uint64 s_unPendingAdvanceTime;
-static SDL_bool s_bBindingComplete;
-
-static SDL_Window *window;
-static SDL_Renderer *screen;
-static GamepadImage *image;
-static SDL_bool done = SDL_FALSE;
-static SDL_bool bind_touchpad = SDL_FALSE;
-
-static int
-StandardizeAxisValue(int nValue)
-{
-    if (nValue > SDL_JOYSTICK_AXIS_MAX / 2) {
-        return SDL_JOYSTICK_AXIS_MAX;
-    } else if (nValue < SDL_JOYSTICK_AXIS_MIN / 2) {
-        return SDL_JOYSTICK_AXIS_MIN;
-    } else {
-        return 0;
-    }
-}
-
-static void
-SetCurrentBinding(int iBinding)
-{
-    int iIndex, iElement;
-    SDL_GameControllerExtendedBind *pBinding;
-    SDL_bool on_front;
-
-    if (iBinding < 0) {
-        return;
-    }
-
-    if (iBinding == BINDING_COUNT) {
-        s_bBindingComplete = SDL_TRUE;
-        return;
-    }
-
-    if (s_arrBindingOrder[iBinding] == -1) {
-        SetCurrentBinding(iBinding + 1);
-        return;
-    }
-
-    if (s_arrBindingOrder[iBinding] == SDL_GAMEPAD_BUTTON_TOUCHPAD &&
-        !bind_touchpad) {
-        SetCurrentBinding(iBinding + 1);
-        return;
-    }
-
-    s_iCurrentBinding = iBinding;
-
-    pBinding = &s_arrBindings[s_arrBindingOrder[s_iCurrentBinding]];
-    SDL_zerop(pBinding);
-
-    for (iIndex = 0; iIndex < s_nNumAxes; ++iIndex) {
-        s_arrAxisState[iIndex].m_nFarthestValue = s_arrAxisState[iIndex].m_nStartingValue;
-    }
-
-    iElement = s_arrBindingOrder[iBinding];
-    on_front = SDL_TRUE;
-    if (iElement >= SDL_GAMEPAD_BUTTON_PADDLE1 &&
-        iElement <= SDL_GAMEPAD_BUTTON_PADDLE4) {
-        on_front = SDL_FALSE;
-    }
-    SetGamepadImageShowingFront(image, on_front);
-
-    ClearGamepadImage(image);
-    if (iElement < SDL_GAMEPAD_BUTTON_MAX) {
-        SDL_GamepadButton eButton = (SDL_GamepadButton)iElement;
-        SetGamepadImageButton(image, eButton, SDL_TRUE);
-    } else {
-        switch (iElement - SDL_GAMEPAD_BUTTON_MAX) {
-        case SDL_GAMEPAD_BINDING_AXIS_LEFTX_NEGATIVE:
-            SetGamepadImageAxis(image, SDL_GAMEPAD_AXIS_LEFTX, -1);
-            break;
-        case SDL_GAMEPAD_BINDING_AXIS_LEFTX_POSITIVE:
-            SetGamepadImageAxis(image, SDL_GAMEPAD_AXIS_LEFTX, 1);
-            break;
-        case SDL_GAMEPAD_BINDING_AXIS_LEFTY_NEGATIVE:
-            SetGamepadImageAxis(image, SDL_GAMEPAD_AXIS_LEFTY, -1);
-            break;
-        case SDL_GAMEPAD_BINDING_AXIS_LEFTY_POSITIVE:
-            SetGamepadImageAxis(image, SDL_GAMEPAD_AXIS_LEFTY, 1);
-            break;
-        case SDL_GAMEPAD_BINDING_AXIS_RIGHTX_NEGATIVE:
-            SetGamepadImageAxis(image, SDL_GAMEPAD_AXIS_RIGHTX, -1);
-            break;
-        case SDL_GAMEPAD_BINDING_AXIS_RIGHTX_POSITIVE:
-            SetGamepadImageAxis(image, SDL_GAMEPAD_AXIS_RIGHTX, 1);
-            break;
-        case SDL_GAMEPAD_BINDING_AXIS_RIGHTY_NEGATIVE:
-            SetGamepadImageAxis(image, SDL_GAMEPAD_AXIS_RIGHTY, -1);
-            break;
-        case SDL_GAMEPAD_BINDING_AXIS_RIGHTY_POSITIVE:
-            SetGamepadImageAxis(image, SDL_GAMEPAD_AXIS_RIGHTY, 1);
-            break;
-        case SDL_GAMEPAD_BINDING_AXIS_TRIGGERLEFT:
-            SetGamepadImageAxis(image, SDL_GAMEPAD_AXIS_LEFT_TRIGGER, 1);
-            break;
-        case SDL_GAMEPAD_BINDING_AXIS_TRIGGERRIGHT:
-            SetGamepadImageAxis(image, SDL_GAMEPAD_AXIS_RIGHT_TRIGGER, 1);
-            break;
-        }
-    }
-
-    s_unPendingAdvanceTime = 0;
-}
-
-static SDL_bool
-BBindingContainsBinding(const SDL_GameControllerExtendedBind *pBindingA, const SDL_GameControllerExtendedBind *pBindingB)
-{
-    if (pBindingA->bindType != pBindingB->bindType) {
-        return SDL_FALSE;
-    }
-    switch (pBindingA->bindType) {
-    case SDL_GAMEPAD_BINDTYPE_AXIS:
-        if (pBindingA->value.axis.axis != pBindingB->value.axis.axis) {
-            return SDL_FALSE;
-        }
-        if (!pBindingA->committed) {
-            return SDL_FALSE;
-        }
-        {
-            int minA = SDL_min(pBindingA->value.axis.axis_min, pBindingA->value.axis.axis_max);
-            int maxA = SDL_max(pBindingA->value.axis.axis_min, pBindingA->value.axis.axis_max);
-            int minB = SDL_min(pBindingB->value.axis.axis_min, pBindingB->value.axis.axis_max);
-            int maxB = SDL_max(pBindingB->value.axis.axis_min, pBindingB->value.axis.axis_max);
-            return minA <= minB && maxA >= maxB;
-        }
-        /* Not reached */
-    default:
-        return SDL_memcmp(pBindingA, pBindingB, sizeof(*pBindingA)) == 0;
-    }
-}
-
-static void
-ConfigureBinding(const SDL_GameControllerExtendedBind *pBinding)
-{
-    SDL_GameControllerExtendedBind *pCurrent;
-    int iIndex;
-    int iCurrentElement = s_arrBindingOrder[s_iCurrentBinding];
-
-    /* Do we already have this binding? */
-    for (iIndex = 0; iIndex < SDL_arraysize(s_arrBindings); ++iIndex) {
-        pCurrent = &s_arrBindings[iIndex];
-        if (BBindingContainsBinding(pCurrent, pBinding)) {
-            if (iIndex == SDL_GAMEPAD_BUTTON_A && iCurrentElement != SDL_GAMEPAD_BUTTON_B) {
-                /* Skip to the next binding */
-                SetCurrentBinding(s_iCurrentBinding + 1);
-                return;
-            }
-
-            if (iIndex == SDL_GAMEPAD_BUTTON_B) {
-                /* Go back to the previous binding */
-                SetCurrentBinding(s_iCurrentBinding - 1);
-                return;
-            }
-
-            /* Already have this binding, ignore it */
-            return;
-        }
-    }
-
-#ifdef DEBUG_GAMEPADMAP
-    switch (pBinding->bindType) {
-    case SDL_GAMEPAD_BINDTYPE_NONE:
-        break;
-    case SDL_GAMEPAD_BINDTYPE_BUTTON:
-        SDL_Log("Configuring button binding for button %d\n", pBinding->value.button);
-        break;
-    case SDL_GAMEPAD_BINDTYPE_AXIS:
-        SDL_Log("Configuring axis binding for axis %d %d/%d committed = %s\n", pBinding->value.axis.axis, pBinding->value.axis.axis_min, pBinding->value.axis.axis_max, pBinding->committed ? "true" : "false");
-        break;
-    case SDL_GAMEPAD_BINDTYPE_HAT:
-        SDL_Log("Configuring hat binding for hat %d %d\n", pBinding->value.hat.hat, pBinding->value.hat.hat_mask);
-        break;
-    }
-#endif /* DEBUG_GAMEPADMAP */
-
-    /* Should the new binding override the existing one? */
-    pCurrent = &s_arrBindings[iCurrentElement];
-    if (pCurrent->bindType != SDL_GAMEPAD_BINDTYPE_NONE) {
-        SDL_bool bNativeDPad, bCurrentDPad;
-        SDL_bool bNativeAxis, bCurrentAxis;
-
-        bNativeDPad = (iCurrentElement == SDL_GAMEPAD_BUTTON_DPAD_UP ||
-                       iCurrentElement == SDL_GAMEPAD_BUTTON_DPAD_DOWN ||
-                       iCurrentElement == SDL_GAMEPAD_BUTTON_DPAD_LEFT ||
-                       iCurrentElement == SDL_GAMEPAD_BUTTON_DPAD_RIGHT);
-        bCurrentDPad = (pCurrent->bindType == SDL_GAMEPAD_BINDTYPE_HAT);
-        if (bNativeDPad && bCurrentDPad) {
-            /* We already have a binding of the type we want, ignore the new one */
-            return;
-        }
-
-        bNativeAxis = (iCurrentElement >= SDL_GAMEPAD_BUTTON_MAX);
-        bCurrentAxis = (pCurrent->bindType == SDL_GAMEPAD_BINDTYPE_AXIS);
-        if (bNativeAxis == bCurrentAxis &&
-            (pBinding->bindType != SDL_GAMEPAD_BINDTYPE_AXIS ||
-             pBinding->value.axis.axis != pCurrent->value.axis.axis)) {
-            /* We already have a binding of the type we want, ignore the new one */
-            return;
-        }
-    }
-
-    *pCurrent = *pBinding;
-
-    if (pBinding->committed) {
-        s_unPendingAdvanceTime = SDL_GetTicks();
-    } else {
-        s_unPendingAdvanceTime = 0;
-    }
-}
-
-static SDL_bool
-BMergeAxisBindings(int iIndex)
-{
-    SDL_GameControllerExtendedBind *pBindingA = &s_arrBindings[iIndex];
-    SDL_GameControllerExtendedBind *pBindingB = &s_arrBindings[iIndex + 1];
-    if (pBindingA->bindType == SDL_GAMEPAD_BINDTYPE_AXIS &&
-        pBindingB->bindType == SDL_GAMEPAD_BINDTYPE_AXIS &&
-        pBindingA->value.axis.axis == pBindingB->value.axis.axis) {
-        if (pBindingA->value.axis.axis_min == pBindingB->value.axis.axis_min) {
-            pBindingA->value.axis.axis_min = pBindingA->value.axis.axis_max;
-            pBindingA->value.axis.axis_max = pBindingB->value.axis.axis_max;
-            pBindingB->bindType = SDL_GAMEPAD_BINDTYPE_NONE;
-            return SDL_TRUE;
-        }
-    }
-    return SDL_FALSE;
-}
-
-static void
-WatchJoystick(SDL_Joystick *joystick)
-{
-    const char *name = NULL;
-    SDL_Event event;
-    SDL_JoystickID nJoystickID;
-
-    image = CreateGamepadImage(screen);
-
-    SDL_RaiseWindow(window);
-
-    /* scale for platforms that don't give you the window size you asked for. */
-    SDL_SetRenderLogicalPresentation(screen, SCREEN_WIDTH, SCREEN_HEIGHT,
-                                     SDL_LOGICAL_PRESENTATION_LETTERBOX,
-                                     SDL_SCALEMODE_LINEAR);
-
-    /* Print info about the joystick we are watching */
-    name = SDL_GetJoystickName(joystick);
-    SDL_Log("Watching joystick %" SDL_PRIs32 ": (%s)\n", SDL_GetJoystickInstanceID(joystick),
-            name ? name : "Unknown Joystick");
-    SDL_Log("Joystick has %d axes, %d hats, and %d buttons\n",
-            SDL_GetNumJoystickAxes(joystick), SDL_GetNumJoystickHats(joystick), SDL_GetNumJoystickButtons(joystick));
-
-    SDL_Log("\n\n\
-    ====================================================================================\n\
-    Press the buttons on your gamepad when indicated\n\
-    (Your gamepad may look different than the picture)\n\
-    If you want to correct a mistake, press backspace or the back button on your 

(Patch may be truncated, please check the link at the top of this post.)