Commit graph

1238 commits

Author SHA1 Message Date
Philipp Wiesemann
1b0a9a82c4 Fixed compiling of three test programs with C++. 2016-10-09 20:31:32 +02:00
Sam Lantinga
7a98ee6c96 Modified the custom cursor test to be able to load BMP files as cursors 2016-10-04 04:08:02 -07:00
Sam Lantinga
c897935592 Fixed bug 3318 - testime.c enhancement with GNU Unifont support
Simon Hug

I'm proposing some changes to the IME test program test/testime.c. The patch includes support for the GNU Unifont hex file, making the SDL_ttf dependency optional. There were also one or two bugs that prevented the text and underline from showing up poperly.
2016-10-01 12:43:14 -07:00
Sam Lantinga
8ad213418b Fixed bug 3319 - Getting the POSIX out of testqsort.c
Simon Hug

There's a call to the POSIX function random in test/testqsort.c. Naturally, Windows doesn't do that. The attached patch changes the call to the SDLtest framework random functions and adds some seed control.

Looking at SDLTest_RandomInitTime, I just want to say that 'srand((unsigned int)time(NULL)); a=rand(); srand(clock()); b=rand();' is an absolutely terrible way to initialize a seed on Windows because of its terrible LCG.
2016-10-01 12:33:26 -07:00
Sam Lantinga
574cc25ce1 Fixed bug 3322 - Missing error checking in testaudioinfo and testaudiohotplug
Simon Hug

The two tests test/testaudioinfo.c and test/testaudiohotplug.c are missing error checking when they call SDL_GetAudioDeviceName. This function can return NULL which the tests pass straight to SDL_Log.
2016-10-01 12:29:55 -07:00
Philipp Wiesemann
0f1075b48e Fixed compiling of three test programs with C++. 2016-09-21 23:06:38 +02:00
Philipp Wiesemann
63c0ba2c47 Fixed log message in audio capture test program. 2016-08-30 21:16:04 +02:00
Ryan C. Gordon
f098bb1934 testaudiocapture: ask for way more output samples.
Fixes Emscripten builds on Chrome for Android.
2016-08-12 22:50:48 -04:00
Ryan C. Gordon
7fd7e882eb testaudiocapture: open capture device to same spec as output device.
...since our resampler is still terrible (sorry!).
2016-08-09 16:57:49 -04:00
Ryan C. Gordon
532edaa024 testaudiocapture: use capture device buffer queueing, for better test coverage. 2016-08-06 02:48:00 -04:00
Ryan C. Gordon
3614f6b9d0 testaudiocapture: don't use fullscreen for the window. 2016-08-06 02:45:51 -04:00
Ryan C. Gordon
047cd6cf87 testaudiocapture: made test app interactive.
(hold down mouse/finger to record, then it plays back what it heard. Repeat.)
2016-08-03 00:31:08 -04:00
Ryan C. Gordon
effa79c36a testaudiocapture: Make a simple green/red window when recording/playing. 2016-08-02 19:17:51 -04:00
Ryan C. Gordon
9396cce861 testaudiocapture: Let specific devices be opened.
--HG--
extra : amend_source : f1b96012549325d102027b574420d369846f4d97
2016-08-02 13:38:56 -04:00
Ryan C. Gordon
d2873d0971 audio: Initial bits to enable audio capture support.
--HG--
extra : histedit_source : ae3938cddad98d32fdec1221ef1ed57ebb2d20e0
2016-08-01 00:18:56 -04:00
Brandon Schaefer
d1caaa42c9 Tests: Would be wise to compile this 2016-07-13 09:41:43 -07:00
Brandon Schaefer
5564d048dc Tests: Somehow tabs leaked in... 2016-07-13 07:39:01 -07:00
Brandon Schaefer
962f8d8766 Tests: Add a manual test for a custom cursor (Taken from the API docs) 2016-07-13 07:34:06 -07:00
Brandon Schaefer
bd6c92676a Tests: Mir needs the window to swap at lease 1 frame for the cursor to show. So render in testwm2 2016-07-13 07:07:46 -07:00
Philipp Wiesemann
93d29988d1 Fixed three source comments in tests. 2016-06-28 21:15:16 +02:00
Philipp Wiesemann
68ef914d7e Added a simple test case for SDL_sscanf() to tests.
It fails on platforms where SDL's custom implementation is used.

Relates to Bugzilla #3341.
2016-06-28 21:14:11 +02:00
Philipp Wiesemann
13dddf1a3b Fixed crash in shape test program if memory allocation failed. 2016-05-10 21:13:58 +02:00
Philipp Wiesemann
104af62971 Fixed error return values in filesystem test program. 2016-05-10 21:12:48 +02:00
Philipp Wiesemann
62a5ddb862 Fixed memory leak in game controller test program. 2016-05-05 22:05:21 +02:00
Philipp Wiesemann
085f0f8b59 Added missing error return in test program. 2016-04-14 21:10:08 +02:00
Philipp Wiesemann
ee01a42541 Removed not needed SDL_WINDOW_SHOWN from chessboard test program. 2016-03-28 21:02:30 +02:00
Philipp Wiesemann
7d41ef944e Fixed compiling IME test program with HAVE_SDL_TTF on C89 compilers. 2016-03-10 21:00:27 +01:00
Philipp Wiesemann
76322d4b81 Removed unnecessary include statement in test program. 2016-03-10 21:00:13 +01:00
Ryan C. Gordon
8fc20326aa A simple test program for SDL_qsort(). 2016-03-10 01:50:43 -05:00
Philipp Wiesemann
15d78542ab Fixed compile warnings about unused variables in IME test program. 2016-03-03 20:11:43 +01:00
Philipp Wiesemann
db1d8e84ae Replaced strlen() with SDL_strlen() in IME test program. 2016-03-02 20:24:43 +01:00
Ryan C. Gordon
f0cab18492 Mac: Implemented SDL_GetDisplayDPI (thanks, Kirill!).
Fixes Bugzilla #3223.
2016-01-07 14:02:37 -05:00
Ryan C. Gordon
eb318de919 Added SDL_DROPBEGIN and SDL_DROPCOMPLETE events, plus window IDs for drops.
This allows an app to know when a set of drops are coming in a grouping of
some sort (for example, a user selected multiple files and dropped them all
on the window with a single drag), and when that set is complete.

This also adds a window ID to the drop events, so the app can determine to
which window a given drop was delivered. For application-level drops (for
example, you launched an app by dropping a file on its icon), the window ID
will be zero.

--HG--
extra : amend_source : d117ff057792aa4827cd846e7786f863a5b55214
extra : histedit_source : e412d6129e61512374a548b1549cbb73de587b5b
2016-01-05 01:42:00 -05:00
Ryan C. Gordon
b8b82c170e Added SDL_DROPTEXT event, for dragging and dropping string data.
This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.

--HG--
extra : histedit_source : e662a1d2d2a9bba6a75c799d9f7228303d654de1
2016-01-05 02:26:45 -05:00
Ryan C. Gordon
6a3cfbf68f Added SDL_GetDisplayUsableBounds().
--HG--
extra : histedit_source : 3c9c2d344e3e3ff20bd86035066b65810346ac3e
2016-01-04 23:52:40 -05:00
Ryan C. Gordon
60493ef8b1 Remove almost all instances of "volatile" keyword.
As Tiffany pointed out in Bugzilla, volatile is not useful for thread safety:

https://software.intel.com/en-us/blogs/2007/11/30/volatile-almost-useless-for-multi-threaded-programming/

Some of these volatiles didn't need to be, some were otherwise protected by
spinlocks or mutexes, and some got moved over to SDL_atomic_t data, etc.

Fixes Bugzilla #3220.
2016-01-03 06:50:50 -05:00
Sam Lantinga
7ee8dda270 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Philipp Wiesemann
402cf280c4 Fixed a comment in two test programs. 2015-12-25 13:41:23 +01:00
Sam Lantinga
312a4eb1bb Fixed whitespace in testspriteminimal.c 2015-12-24 06:11:05 -08:00
Sam Lantinga
7d9b80ccb3 Fixed mapping third party XBox controllers that have the trigger axis all the way in until they are pulled and get updated values. 2015-12-18 18:49:23 -08:00
Philipp Wiesemann
35753b6dbb Fixed outdated information in README for test programs.
Two programs were removed some time ago and one was renamed.
2015-12-07 21:43:16 +01:00
Philipp Wiesemann
75a8a947fd Changed comment in test program to avoid confusion.
There is a library called SDL_sound which is not used here.
2015-12-06 17:50:51 +01:00
Philipp Wiesemann
b5437b59e3 Fixed comment in filesystem test program. 2015-12-04 22:12:36 +01:00
Philipp Wiesemann
9d304679f0 Fixed compile error in timer test program if PRIu64 not available. 2015-12-01 22:24:04 +01:00
Philipp Wiesemann
b5e3bd6ec1 Fixed compile warning in IME test program. 2015-12-01 22:22:58 +01:00
Philipp Wiesemann
525d8bfbe5 Fixed filesystem test program to compile with older versions of C. 2015-12-01 22:21:29 +01:00
Philipp Wiesemann
da4d0e4a52 Replaced tabs with spaces in test programs. 2015-11-25 21:39:28 +01:00
Ryan C. Gordon
03cb578e6e Added SDL_JoystickFromInstanceID() and SDL_GameControllerFromInstanceID().
--HG--
extra : amend_source : 110a5505509ddb9ecafed75abd89602986a99696
2015-11-14 12:35:45 -05:00
Philipp Wiesemann
174b5f8110 Fixed freeing uninitialized pointers on failure cleanup in tests. 2015-10-07 21:16:59 +02:00
Alex Szpakowski
0023cbb086 Added initial support for MFi game controllers on iOS. 2015-09-20 23:08:36 -03:00