Sam Lantinga
f08a5cfcab
Fixed sscanf("026", "%1x%1x%1x", &r, &g, &b)
...
Fixes https://github.com/libsdl-org/SDL/issues/12510
(cherry picked from commit be6ed6e9c4
)
(cherry picked from commit 1caae3e9e4
)
2025-03-10 15:45:43 -07:00
Sam Lantinga
024c27645a
Added support for the "%n" sscanf format specifier
...
(cherry picked from commit 6980325310
)
(cherry picked from commit ab44451578
)
2025-02-25 08:08:55 -08:00
Sam Lantinga
2847273885
Fixed mis-cherry-pick
2025-02-01 11:03:33 -08:00
Anonymous Maarten
799ede831e
testatomic: destroy threads + free all memory at quit to fix --trackmem
...
(cherry picked from commit 831c79d32f
)
2025-02-01 11:02:53 -08:00
Erica Z
f804293a27
fix integer overflow ub in testautomation_sdltest
...
Patch originally from https://github.com/libsdl-org/sdl2-compat/pull/241
2025-01-06 10:37:46 -05:00
Erica Z
793103ef52
comment out signed multiplication overflow ub in testplatform
...
Patch originally from https://github.com/libsdl-org/sdl2-compat/pull/241
2025-01-06 10:36:32 -05:00
Anonymous Maarten
840638404a
testautomation: port back SDL3's strtol and strtod tests
...
Triggered by b713e7581b
2025-01-02 01:31:34 +01:00
Sam Lantinga
2b5b8fdbd5
Updated copyright for 2025
2025-01-01 07:47:53 -08:00
Anonymous Maarten
ba433e4a5d
ci: merge all workflows
2024-11-23 20:00:37 +01:00
L zard
b308172862
testautomation keyboard: use space
instead of a
...
(cherry picked from commit 1ed1bc1d5d
)
2024-11-08 18:21:32 +03:00
Wouter Wijsman
7cbb131c75
PSP: Allow building tests in parallel
2024-11-01 08:56:13 -04:00
Cameron Cawley
d7bb56f163
3DS: Only bundle resources with tests that need them
2024-10-12 16:06:54 -07:00
Cameron Cawley
e2f27362cb
testdrawchessboard: Allow using the standard render API
2024-10-12 13:56:51 -07:00
Sam Lantinga
1b26b54402
Verify that the subsystems were successfully initialized
...
(cherry picked from commit 0548050fc5
)
2024-09-15 12:05:31 -07:00
Sam Lantinga
224a37faab
Fixed memory leak in testthread
...
(cherry picked from commit dfe6efcd2d
)
2024-09-05 07:11:56 -07:00
Sam Lantinga
a75227aaeb
Use atomic variables for thread communication
...
Fixes https://github.com/libsdl-org/SDL/issues/10711
(cherry picked from commit a0f36fb85b
)
2024-09-05 07:09:27 -07:00
Ozkan Sezer
37d3eea939
testlocale, testplatform, testqsort: replace exit(1) calls with return 1
2024-09-05 00:28:32 +03:00
Anonymous Maarten
2ae8b4c651
test: use SDL_test for parsing arguments in all non-interactive tests
2024-08-31 23:49:22 +02:00
Anonymous Maarten
622b511613
Copy sdlprocdump from SDL3
2024-08-31 23:49:22 +02:00
Anonymous Maarten
564765d22b
ctest: fail if there are outstanding allocations
...
backport of b68ac011e0
2024-08-31 23:49:22 +02:00
Anonymous Maarten
52090046fe
cmake: ios and tvos applications need to link to SDL2main library
2024-08-14 10:35:43 +00:00
Anonymous Maarten
3d7007fb2d
testgles: ignore GLES deprecation on Apple platforms
2024-08-14 10:35:43 +00:00
Sam Lantinga
2efbe7fa3f
Implemented left-justification in SDL_PrintString()
...
Fixes https://github.com/libsdl-org/SDL/issues/10310
(cherry picked from commit f59d66f4b1
)
2024-08-04 20:05:41 -07:00
Ozkan Sezer
73066492f6
testshader.c: include stdlib.h for exit()
2024-07-22 17:40:56 +03:00
Amir
ccade50587
Fix warning for Android NDK compiler: "function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]"
...
https://stackoverflow.com/questions/42125/warning-error-function-declaration-isnt-a-prototype
In C int foo() and int foo(void) are different functions. int foo() accepts an arbitrary number of arguments, while int foo(void) accepts 0 arguments. In C++ they mean the same thing.
2024-07-17 10:51:30 -07:00
Anonymous Maarten
a25f94c9a8
ci: run VC tests under sdlprocdump
2024-07-12 18:47:18 +02:00
Anonymous Maarten
bba51871a8
cmake: only link SDL2 against test executables
2024-07-12 18:47:18 +02:00
Sam Lantinga
288aea3b40
Fixed build
2024-06-29 11:22:29 -07:00
Sam Lantinga
a3f0c373d3
Clean up any renderer in SDL_DestroyWindowSurface()
...
Also added an automated test to verify window surface functionality.
Fixes https://github.com/libsdl-org/SDL/issues/10133
(cherry picked from commit a522bfe3f1
)
2024-06-29 11:04:15 -07:00
Sam Lantinga
51ba036e64
Verify that the timer callback is passed the correct parameters
2024-05-30 16:53:28 -07:00
Ozkan Sezer
63ea838db6
test, watcom.mif: revert 78391e6530
...
%copy isn't recognized by older wmake versions.
2024-05-01 17:37:20 +03:00
Ozkan Sezer
78391e6530
test, watcom.mif: revert 9ecdcd8bb
and use %copy instead
...
Ref.: https://github.com/open-watcom/open-watcom-v2/issues/1281 .
2024-05-01 17:02:50 +03:00
Ozkan Sezer
9ecdcd8bb6
test, watcom makefile: change copy command to use a dos path separator
...
fixes copy failure with recent open watcom wmake changes. (Issue reported
mainstream as https://github.com/open-watcom/open-watcom-v2/issues/1281 )
2024-05-01 11:02:10 +03:00
Cameron Cawley
154ec5c57a
testmouse: Create the window on the touch screen when building for the 3DS
2024-04-15 03:33:10 -10:00
Anonymous Maarten
3184936950
cmake: we only need a C++ compiler for Android, Haiku and UWP
2024-03-11 01:26:13 +01:00
Sam Lantinga
05bb182a53
Don't test 10-bit pixel format conversion
...
We either need to explicitly test using the sRGB colorspace or update the tests for HDR10 color conversion. We'll just disable them for now, as these formats aren't commonly used in games.
(cherry picked from commit f9c57e16b0
)
2024-02-02 18:26:01 -08:00
Simon McVittie
58907d2c27
testautomation_math: Fix misleading log output
...
These originally checked for expected ± EPSILON as logged, but since
commit 880c6939
they check for expected ± max_err, where max_err may
need to be greater than EPSILON for very large expected results like
the ones in exp_regularCases().
Also, EPSILON is so small that the default precision of the %f format
(6 decimal places) would never actually have shown its effect, so log
it in scientific notation instead.
Fixes: 880c6939
"testautomation_math: do relative comparison + more precise correct trigonometric values"
Signed-off-by: Simon McVittie <smcv@collabora.com >
2024-02-02 07:45:06 -08:00
Simon McVittie
a7bd18c0d5
test: Don't accept results that are much less than expected
...
While looking at the other tests in this file, I noticed that instead
of checking for a result in the range of expected ± FLT_EPSILON as I
would have expected, these tests would accept any result strictly less
than expected + FLT_EPSILON, for example a wrong result that is very
large and negative. This is presumably not what was intended, so add
the SDL_fabs() that I assume was meant to be here.
Fixes: 474c8d00
"testautomation: don't do float equality tests"
Signed-off-by: Simon McVittie <smcv@collabora.com >
2024-02-02 07:45:06 -08:00
Simon McVittie
f73abd49c3
testautomation: Don't expect exp to yield exact floating point results
...
In the Steam Runtime 1 'scout' environment, when compiling for i386
using the default gcc-4.6, Exp(34.125) matches the desired value to the
precision shown in the log (6 decimal places) but is not an exact match
for the desired value.
Signed-off-by: Simon McVittie <smcv@collabora.com >
2024-02-02 07:45:06 -08:00
Sam Lantinga
c55bd24827
Fixed testautomation log callback calling convention
...
(cherry picked from commit 9f7eb6c4c1
)
2024-01-27 22:44:55 -08:00
Sam Lantinga
bb30a35364
Fixed Watcom build
2024-01-27 20:28:43 -08:00
Sam Lantinga
11c932bf1d
Fixed build
2024-01-27 20:18:39 -08:00
Sam Lantinga
f0b8fee88f
Added the environment variable SDL_LOGGING to control default log output
...
(cherry picked from commit 12bdb2b4d0
)
2024-01-27 19:46:25 -08:00
Ozkan Sezer
aaf426e280
testhaptic.c: include stdlib.h for exit()
2024-01-23 01:20:00 +03:00
Simon McVittie
55ba686530
test: Run testautomation under Autotools too, not just CMake
...
The CMake build system runs this since #8313 , so we already have to make
sure it doesn't regress.
Signed-off-by: Simon McVittie <smcv@collabora.com >
2024-01-22 06:33:27 -08:00
Simon McVittie
4cb43db1a9
test: Don't distinguish between different categories of tests
...
It's reasonable to assume that any of them might need a display and an
audio backend. We run them with SDL_VIDEODRIVER and SDL_AUDIODRIVER
set to dummy anyway.
Signed-off-by: Simon McVittie <smcv@collabora.com >
2024-01-22 06:33:27 -08:00
Frank Praznik
f569cc56a9
tests: Fix automated audio tests on Windows and Linux
...
If a specific audio driver was requested for testing, don't loop over all drivers in the init, open/close, and pause/unpause tests.
Additionally, drivers can fail if attempting to open an audio device when no underlying output is present, which is a valid case if the system has no audio hardware available. Check for the presence of audio output devices before attempting to open them.
Fixes automated tests with various drivers on Windows and Linux.
2024-01-21 23:44:53 +01:00
Anonymous Maarten
a420eb79bb
cmake: run testautomation with CTest on ci
2024-01-21 23:44:53 +01:00
Anonymous Maarten
41fc398114
Move check for SDL_Delay upper bounds to testtimer
...
(cherry picked from commit f45761908a
)
2024-01-21 23:44:53 +01:00
Anonymous Maarten
1737340978
Use helper_ddtod function to compare atan2 infinity cases
...
This fixes a test failure when building on mingw32 in Release mode.
2024-01-21 23:44:53 +01:00