diff options
author | Andreas Schiffler <aschiffler@ferzkopp.net> | 2013-08-14 23:30:10 -0700 |
---|---|---|
committer | Andreas Schiffler <aschiffler@ferzkopp.net> | 2013-08-14 23:30:10 -0700 |
commit | d18b52844dcacef57721a81bd2424a9de6baaa5b (patch) | |
tree | a4332e394e69a39b6e7ae5d0619f1baa6e8dd2b7 /test/torturethread.c | |
parent | 874dd7a8c5ef9a1fd36a2f89fe467631886b1215 (diff) | |
download | sdl-d18b52844dcacef57721a81bd2424a9de6baaa5b.tar.gz |
Fix bug 2034: replace printf by SDL_Log in tests; update loopwave VS solution: copy missing dependency
Diffstat (limited to 'test/torturethread.c')
-rw-r--r-- | test/torturethread.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/test/torturethread.c b/test/torturethread.c index 795b60b93..53a57a9b0 100644 --- a/test/torturethread.c +++ b/test/torturethread.c @@ -49,7 +49,7 @@ ThreadFunc(void *data) int i; int tid = (int) (uintptr_t) data; - fprintf(stderr, "Creating Thread %d\n", tid); + SDL_Log("Creating Thread %d\n", tid); for (i = 0; i < NUMTHREADS; i++) { char name[64]; @@ -58,18 +58,18 @@ ThreadFunc(void *data) sub_threads[i] = SDL_CreateThread(SubThreadFunc, name, &flags[i]); } - printf("Thread '%d' waiting for signal\n", tid); + SDL_Log("Thread '%d' waiting for signal\n", tid); while (time_for_threads_to_die[tid] != 1) { ; /* do nothing */ } - printf("Thread '%d' sending signals to subthreads\n", tid); + SDL_Log("Thread '%d' sending signals to subthreads\n", tid); for (i = 0; i < NUMTHREADS; i++) { flags[i] = 1; SDL_WaitThread(sub_threads[i], NULL); } - printf("Thread '%d' exiting!\n", tid); + SDL_Log("Thread '%d' exiting!\n", tid); return 0; } @@ -80,9 +80,12 @@ main(int argc, char *argv[]) SDL_Thread *threads[NUMTHREADS]; int i; + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + /* Load the SDL library */ if (SDL_Init(0) < 0) { - fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); return (1); } @@ -94,7 +97,7 @@ main(int argc, char *argv[]) threads[i] = SDL_CreateThread(ThreadFunc, name, (void*) (uintptr_t) i); if (threads[i] == NULL) { - fprintf(stderr, "Couldn't create thread: %s\n", SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create thread: %s\n", SDL_GetError()); quit(1); } } |