We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2034 - All tests should use SDL_Log or SDLTest_Log in favor of printf/frprintf to enable console output on Windows builds
Summary: All tests should use SDL_Log or SDLTest_Log in favor of printf/frprintf to en...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: 2.0.0
Hardware: x86 Windows 7
: P2 minor
Assignee: Andreas Schiffler
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-13 22:37 UTC by Andreas Schiffler
Modified: 2013-08-15 02:32 UTC (History)
0 users

See Also:


Attachments
printf usage in test code (33.17 KB, text/plain)
2013-08-13 22:37 UTC, Andreas Schiffler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schiffler 2013-08-13 22:37:24 UTC
Created attachment 1285 [details]
printf usage in test code

On 8/13/2013 10:15 AM, George Brink wrote:
> Second problem.
> All tests are compiled with -mwindows key, even those which are supposed to be a console applications. So no stdout/stderr is available and all printf()/frprintf(stderr) are going to nul.
> Manual recompilation without -mwindows key solves the problem. 

All the printf's should be converted to SDL_Log or SDLTest_Log calls which will go through the platform specific SDL output routine which will attach the console streams on windows if available.

Changes needed are:
$ grep printf *.[ch] | grep -v SDL_snprintf | grep -v SDL_vsnprintf | grep -v "Binary file" >test-printfs.txt
Comment 1 Sam Lantinga 2013-08-14 02:39:48 UTC
Agreed!
Comment 2 Andreas Schiffler 2013-08-14 12:01:04 UTC
Working on it (nice and easy project).
Comment 3 Andreas Schiffler 2013-08-15 02:32:51 UTC
Fixed with:
http://hg.libsdl.org/SDL/rev/9406b7dd2f2d