Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
video_test: Mitigate unsuitability of SDL_GetError() for detecting fa…
…ilure SDL_GetError() is like errno: it's documented not to be suitable for detecting failure, only for getting more details if failure was already detected (its result is unspecified on success, because a successful API call might have been implemented by doing something that failed, detecting that, and falling back to doing something different). However, some functions in SDL2 return void, so we have no other way to tell whether they have failed (they do return a result in SDL3). To make it less likely that upgrading SDL2 will make these tests regress, clear the error indicator immediately before calling the function under test. It is still not guaranteed to be empty on success, but at least this way we make sure it doesn't already contain an error message from a previous function call. Helps: #257 Signed-off-by: Simon McVittie <[email protected]>
- Loading branch information