Commit graph

11829 commits

Author SHA1 Message Date
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
Sylvain 237535b23a
Fixed bug #8897 - SDL_BlitSurface segfault when dest_rect is null 2024-01-22 09:22:41 +01:00
yuanhecai ed5d3d9f82 Fix compilation on loongarch 2024-01-21 19:27:59 -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
Frank Praznik 06dd70bc8b video: Use string comparison instead of #ifdefs for driver detection
The dummy driver can be in use on these platforms, so check the actual driver name string.

Fixes the automated video tests with the dummy driver on Win32.
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 f45761908aa88c61cf7f2b7cb2e663abee06eed0)
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
Anonymous Maarten 69a6efcd1b Avoid using higher precision floating point numbers by using it in a function 2024-01-21 23:44:53 +01:00
Anonymous Maarten fbee0b86bf video: verify SDL_GetNumVideoDisplays is succesful 2024-01-21 23:44:53 +01:00
Anonymous Maarten 880c69392a testautomation_math: do relative comparison + more precise correct trigonometric values 2024-01-21 23:44:53 +01:00
Anonymous Maarten 811adaa342 Only test error message when using specific video drivers
The dummy driver does not sen an error message when passing
a NULL rect argument to SDL_SetTextInputRect.
2024-01-21 23:44:53 +01:00
Sylvain 5368f45567 Remove one test that contains call of SDL_Quit() / SDL_Init() because it
conficts with the initializaion of test common.
(before it used SDL_VideoInit SDL_VideoQuit which weren't perturbated by SDL_Quit())
2024-01-21 23:44:53 +01:00
Sylvain 3d5679bb8e Fix video_getSetWindowPosition() that fail when checking events,
because testautomation_events.c() didn't finish to poll all events before

(cherry picked from commit 3ccfd361cb4ff081f7696e5fbc4174f5d4aa1ca1)
2024-01-21 23:44:53 +01:00
Sam Lantinga e3203278f4 Updated tests so they'll pass if we enable the C runtime in SDL2.dll
This isn't needed here, but will be necessary for sdl2-compat
2024-01-21 11:23:50 -08:00
Ethan Lee b5aec14d43 gdk: Backport SDL3 MR #8844
Co-authored-by: chalonverse <sanjay12@gmail.com>
2024-01-21 13:55:17 -05:00
Ozkan Sezer 8eb2ec6a8d watcom makefiles: remove yuv_rgb_lsx.c from sources 2024-01-21 11:56:20 +03:00
Sam Lantinga 83f3045ee8 Revert "updated WhatsNew.txt"
This reverts commit c3a3f18076.
2024-01-20 05:28:05 -08:00
Sylvain f1bc5f305c
Prevent asan warning on qsort():
'src/stdlib/SDL_qsort.c:27:5: runtime error: null pointer passed as argument 1, which is declared to never be null`

(cherry picked from commit 2cd583ee13ec4660d7fbe6e6d8293744d3343071)
2024-01-20 11:26:37 +01:00
Ozkan Sezer c3a3f18076 updated WhatsNew.txt 2024-01-20 11:51:00 +03:00
Sylvain 5d6eb4a5a5
Fixed overflow in SDL_SoftStretch() (see #8878)
(cherry picked from commit 7b02d328fa691a18583fdc762541c7fb8c1ba09b)
2024-01-20 06:39:21 +01:00
Sam Lantinga cfc22ac7d7 Added patch notes for the SDL 2.30.0 release 2024-01-19 20:11:07 -08:00
Sam Lantinga b4f99deb9e Updated to version 2.29.1 for RC build 2024-01-19 19:58:24 -08:00
Ryan C. Gordon 1e13aa2c98
androidaudio: same fix as AAudio for pausing thread when backgrounding app.
Reference Issue #8748.
2024-01-19 22:15:27 -05:00
Sam Lantinga 109bb2f17e Make sure the render target isn't bound as a resource
Fixes https://github.com/libsdl-org/SDL/issues/3380

(cherry picked from commit a73132177d3311e70196f8de4e8a2e3b0b70cbcf)
2024-01-19 15:18:14 -08:00
Sam Lantinga f7ab765b84 Fixed crash scaling very large surfaces
Fixes https://github.com/libsdl-org/SDL/issues/8878

(cherry picked from commit 09ba55b462b826070482a586b72906fae4a66b32)
2024-01-19 13:06:57 -08:00
Ryan C. Gordon 910e040e9e
aaudio: Block the audio device thread when in the background.
Fixes #8748.
2024-01-19 15:10:43 -05:00
Sylvain Becker bb969ac747 Fixed bug #7614: Segmentation Fault in SDL_BlitSurface (#7808)
Update SDL_BlitSurface to use Intersect functions

(cherry picked from commit 3639743d8909406557663af0854dc7bd97956b24)
2024-01-19 08:53:16 -08:00
Sam Lantinga 87b5bb5840 Fixed potential overflow in software triangle rendering
(cherry picked from commit bd5d4d61edc95f1f003ec91597418fc416ff8315)
2024-01-19 08:33:39 -08:00
Sam Lantinga 11b111e1f8 Fixed types used in documentation (thanks @Dragon-Baroque!) 2024-01-19 05:26:44 -08:00
Sam Lantinga be576c5fe7 Updated Xcode projects after 472a415c8f 2024-01-18 17:08:20 -08:00
Anonymous Maarten 472a415c8f video: move standard c, sse and lsx implementations of yuv2rgb to its own source 2024-01-18 17:06:27 -08:00
Simon McVittie 0d9719964f testautomation_surface: Make sure error is set by the function we expect
If the error behaviour in one of these cases was wrong, that could have
been hidden by the error indicator remaining set from a previous test.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-18 13:22:11 -08:00
Simon McVittie e8075179e0 testautomation_surface: Really make width * bpp overflow
A surface of width (0x7fff'ffff) / 2 = 0x3fff'ffff is not quite large
enough to make the pitch overflow in the way we wanted to test here:
with a 32-bit format, that makes each row 0xffff'fffc bytes, which
(just) fits in a 32-bit unsigned size_t. Increasing it to 0x4000'0000
pixels per row is enough to trigger the overflow we intended to test.

In SDL 2, this test bug was hidden by the fact that allocating
0xffff'fffc bytes on a 32-bit platform is very likely to fail, and SDL 2
reported both "malloc() failed" and "this amount of memory is too large
for a size_t" with the same error code.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-18 13:22:11 -08:00
Simon McVittie 62d063f735 testautomation_surface: Really make pitch + alignment overflow
Adding 3 bytes of alignment to 0x7fff'ffff is not enough to make it
overflow a 4-byte unsigned size_t, so this test was not exercising
the intended failure mode. We cannot actually make this overflow
with a signed 32-bit width and an 8-bit format: the maximum width is
not enough to achieve that. However, if we switch to a 24-bit format,
we can make the calculation overflow.

In SDL 2, this test bug was hidden by the fact that allocating
0x7fff'ffff bytes on a 32-bit platform will usually fail, and SDL 2
reported both "malloc() failed" and "this amount of memory is too large
for a size_t" with the same error code.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-18 13:22:11 -08:00
Ryan C. Gordon cc7fe8c255
x11: XI_Motion should mark the global mouse position as changed.
Otherwise we'll miss it when XWarpPointer() is used. x11vnc may do this to
manage mouse input in some circumstances, so it can be possible for _all_
mouse motion to go through this path, breaking SDL_GetGlobalMouseState().

Thanks to @chrismile for all the detective work to figure this out!

Fixes #8827.
2024-01-18 15:10:16 -05:00
Ozkan Sezer f52a12a8fe remove several instances of unnecessary emptry str "" after SDL_PRI??? 2024-01-18 17:25:56 +03:00
Ozkan Sezer 3d6cf2b5c0 update config.guess and config.sub from mainstream 2024-01-18 00:29:56 +03:00
Ryan C. Gordon f7f9478caf
docs: Note SDL_UpdateWindowSurfaceRects can update beyond specified areas.
Reference Issue #8825.
2024-01-16 15:23:56 -05:00
Sylvain 9db80adfba Fixed bug #7614: Segmentation Fault in SDL_BlitSurface
(cherry picked from commit e6c8872fdc8d9b8aa5e208c9b55c6f230674a13d)
2024-01-16 07:11:19 -08:00
Sylvain f3b0dc5007 Fixed bug #8301 - Software renderer draws long lines incorrectly / SDL_RENDERLINEMETHOD_GEOMETRY
(cherry picked from commit ce0e0675de02411f0aafa526cd704f7fff1f1376)
2024-01-16 07:08:15 -08:00
Ryan C. Gordon c69e858e7a
audio: Patched to compile (mixed declarations and code). 2024-01-16 10:07:14 -05:00
Ryan C. Gordon 1e2f311811
audio: backport SDL3's audio datatype converters.
These are faster and more precise.

This did not change the Uint16 versions (as SDL3 dropped them, and honestly
no one should be using them in SDL2), nor the NEON converters (as this was
not changed in SDL3, so far).

Fixes #8786.
2024-01-16 10:04:09 -05:00
Sam Lantinga eae81ec80e Touchpads already have their right/left buttons swapped in raw input
Fixes https://github.com/libsdl-org/SDL/issues/8597

(cherry picked from commit cf5e0637b5454b776f749beea856f1f595e03036)
2024-01-15 19:46:31 -08:00
Sam Lantinga f641d91f67 Restore window minimum and maximum size if it is recreated
Fixes https://github.com/libsdl-org/SDL/issues/8805

(cherry picked from commit fb2d7ed83efbeebeb537ea8c17694585c05ce8e3)
2024-01-15 16:35:03 -08:00
Susko3 38d11e5cc6 Add missing (void) in functions params 2024-01-13 11:45:44 -08:00
Susko3 bbe4d693eb Use correct touch check flag
Matches the one in `GetMouseMessageSource()`.
From my testing on Windows 11, the lower 8 bits in touch events cycle
trough the values 0x8c-0x95 in order.

(cherry picked from commit d747daf03d3210a794d609b8cc662f28beaedaf6)
2024-01-13 11:44:43 -08:00
Sam Lantinga b6e97d9ff0 Fixed Xcode warnings 2024-01-13 08:15:41 -08:00
Sam Lantinga 5db6eb7742 Removed reference to deleted header from Xcode project 2024-01-13 08:10:04 -08:00