Commit graph

16 commits

Author SHA1 Message Date
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
Simon McVittie 4f2c7328d6 test: Use AUDIO_F32SYS for native-endianness
AUDIO_F32 is an alias for AUDIO_F32LSB, 32-bit floating point with least
significant byte first, resulting in audio_resampleLoss() failing on
big-endian machines. This particular test generates a buffer with
native-endianness float values, so it ought to be using AUDIO_F32SYS,
which is 32-bit floating point in the native endianness.

Already fixed by commit 47bcb078 "Fixed some incorrect SDL_AUDIO_F32 uses"
on the SDL 3 branch.

Resolves: https://github.com/libsdl-org/SDL/issues/8818
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-10 06:10:23 -08:00
Sam Lantinga 4c11307a4e Only initialize audio drivers that have been requested
If testautomation is running with only a specific audio driver enabled, we shouldn't try to open other ones, as they might fail.

Fixes https://github.com/libsdl-org/SDL/issues/8797
2024-01-08 13:38:29 -08:00
Anonymous Maarten d2a2787783 Fix remaining -Wimplicit-fallthrough warnings 2023-03-28 19:24:33 +02:00
Anonymous Maarten ec3e333fb8 testautomation_audio: fix -Wimplicit-fallthrough warning
(cherry picked from commit 11c70406c322b5686f35349acc9659c4d8d5a8f7)
2023-03-28 10:21:36 -07:00
Qrox ef347776c2 Uses integer arithmetics in SDL_ResampleAudio
- Avoids precision loss caused by large floating point numbers.
- Adds unit test to test the signal-to-noise ratio and maximum error of resampler.
- Code cleanup

(cherry-picked from commit 20e17559e545c5d3cfe86c1c4772365e70090779)
2023-03-10 18:37:00 +03:00
Pierre Wendling d0bbfdbfb8 Clang-Tidy fixes (#6725)
(cherry picked from commit 3c501b963dd8f0605a6ce7978882df39ba76f9cd)
2022-12-01 13:08:50 -08:00
Sam Lantinga b8d85c6939 Update for SDL3 coding style (#6717)
I updated .clang-format and ran clang-format 14 over the src and test directories to standardize the code base.

In general I let clang-format have it's way, and added markup to prevent formatting of code that would break or be completely unreadable if formatted.

The script I ran for the src directory is added as build-scripts/clang-format-src.sh

This fixes:
#6592
#6593
#6594

(cherry picked from commit 5750bcb174300011b91d1de20edb288fcca70f8c)
2022-11-30 12:57:41 -08:00
Sylvain Becker fb0ce375f0 Cleanup add brace (#6545)
* Add braces after if conditions

* More add braces after if conditions

* Add braces after while() conditions

* Fix compilation because of macro being modified

* Add braces to for loop

* Add braces after if/goto

* Move comments up

* Remove extra () in the 'return ...;' statements

* More remove extra () in the 'return ...;' statements

* More remove extra () in the 'return ...;' statements after merge

* Fix inconsistent patterns are xxx == NULL vs !xxx

* More "{}" for "if() break;"  and "if() continue;"

* More "{}" after if() short statement

* More "{}" after "if () return;" statement

* More fix inconsistent patterns are xxx == NULL vs !xxx

* Revert some modificaion on SDL_RLEaccel.c

* SDL_RLEaccel: no short statement

* Cleanup 'if' where the bracket is in a new line

* Cleanup 'while' where the bracket is in a new line

* Cleanup 'for' where the bracket is in a new line

* Cleanup 'else' where the bracket is in a new line

(cherry picked from commit 6a2200823c66e53bd3cda4a25f0206b834392652 to reduce conflicts merging between SDL2 and SDL3)
2022-11-28 12:33:03 -08:00
Pierre Wendling 6784d84c9d N3DS: Fix -Wformat warnings in tests.
All warnings were about invalid specifiers. Since U/Sint32 is a long,
using `%d` emits a -Wformat warning.
2022-10-10 08:50:59 -07:00
Anonymous Maarten b771d9beec tests: avoid MSVC preaching about unsafe functions 2022-10-08 23:41:07 +02:00
Ozkan Sezer 990fb668f7 tests: several -Wwrite-strings fixes. 2021-11-20 01:02:02 +03:00
Ryan C. Gordon 2542977b0a
Revert "Update wiki.libsdl.org urls to libsdl-org/SDL/wiki (#4069)"
This reverts commit 82a96afa70.

We ended up not moving to GitHub's wiki after all and built
https://github.com/icculus/ghwikipp to fill the gap...since the wiki is
back at https://wiki.libsdl.org/, put back the original URLs.
2021-04-01 12:15:28 -04:00
Erik Yuzwa 82a96afa70
Update wiki.libsdl.org urls to libsdl-org/SDL/wiki (#4069) 2021-02-13 11:49:31 -05:00
Sam Lantinga ca5c304814 Fixed bug 3744 - missing SDLCALL in several functions
Ozkan Sezer

The attached patch adds missing SDLCALL to several functions, so that
they properly match the headers as intended.
2017-08-13 21:06:52 -07:00
Philipp Wiesemann 0e45984fa0 Fixed crash if initialization of EGL failed but was tried again later.
The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly
uninitialized data structure if loading the library first failed. A later try to
use EGL then skipped initialization and assumed it was previously successful
because the data structure now already existed. This led to at least one crash
in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was
dereferenced to make a call to eglBindAPI().
2015-06-21 17:33:46 +02:00