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

Summary: All tests should use SDL_Log or SDLTest_Log in favor of printf/frprintf to enable console output on Windows builds
Product: SDL Reporter: Andreas Schiffler <aschiffler>
Component: *don't know*Assignee: Andreas Schiffler <aschiffler>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2    
Version: 2.0.0   
Hardware: x86   
OS: Windows 7   
Attachments: printf usage in test code

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