Fix bug 2034: replace printf by SDL_Log in tests; update loopwave VS solution: copy missing dependency
This commit is contained in:
parent
a0bc602061
commit
16a40598f6
47 changed files with 616 additions and 505 deletions
|
@ -62,7 +62,7 @@ button_messagebox(void *eventNumber)
|
|||
|
||||
success = SDL_ShowMessageBox(&data, &button);
|
||||
if (success == -1) {
|
||||
printf("Error Presenting MessageBox: %s\n", SDL_GetError());
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError());
|
||||
if (eventNumber) {
|
||||
SDL_UserEvent event;
|
||||
event.type = (intptr_t)eventNumber;
|
||||
|
@ -72,7 +72,7 @@ button_messagebox(void *eventNumber)
|
|||
quit(2);
|
||||
}
|
||||
}
|
||||
printf("Pressed button: %d, %s\n", button, button == 1 ? "Cancel" : "OK");
|
||||
SDL_Log("Pressed button: %d, %s\n", button, button == 1 ? "Cancel" : "OK");
|
||||
|
||||
if (eventNumber) {
|
||||
SDL_UserEvent event;
|
||||
|
@ -88,12 +88,15 @@ main(int argc, char *argv[])
|
|||
{
|
||||
int success;
|
||||
|
||||
/* Enable standard application logging */
|
||||
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
|
||||
|
||||
success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
|
||||
"Simple MessageBox",
|
||||
"This is a simple error MessageBox",
|
||||
NULL);
|
||||
if (success == -1) {
|
||||
printf("Error Presenting MessageBox: %s\n", SDL_GetError());
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError());
|
||||
quit(1);
|
||||
}
|
||||
|
||||
|
@ -102,7 +105,7 @@ main(int argc, char *argv[])
|
|||
"This is a simple MessageBox with a newline:\r\nHello world!",
|
||||
NULL);
|
||||
if (success == -1) {
|
||||
printf("Error Presenting MessageBox: %s\n", SDL_GetError());
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError());
|
||||
quit(1);
|
||||
}
|
||||
|
||||
|
@ -112,7 +115,7 @@ main(int argc, char *argv[])
|
|||
"Unicode text: '牛肉西蘭花' ...",
|
||||
NULL);
|
||||
if (success == -1) {
|
||||
printf("Error Presenting MessageBox: %s\n", SDL_GetError());
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError());
|
||||
quit(1);
|
||||
}
|
||||
|
||||
|
@ -122,7 +125,7 @@ main(int argc, char *argv[])
|
|||
"Unicode text and newline:\r\n'牛肉西蘭花'\n'牛肉西蘭花'",
|
||||
NULL);
|
||||
if (success == -1) {
|
||||
printf("Error Presenting MessageBox: %s\n", SDL_GetError());
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError());
|
||||
quit(1);
|
||||
}
|
||||
|
||||
|
@ -135,7 +138,7 @@ main(int argc, char *argv[])
|
|||
subsystem on the main thread.
|
||||
*/
|
||||
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
|
||||
fprintf(stderr, "Couldn't initialize SDL video subsystem: %s\n", SDL_GetError());
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL video subsystem: %s\n", SDL_GetError());
|
||||
return (1);
|
||||
}
|
||||
{
|
||||
|
@ -153,7 +156,7 @@ main(int argc, char *argv[])
|
|||
|
||||
SDL_WaitThread(thread, &status);
|
||||
|
||||
printf("Message box thread return %i\n", status);
|
||||
SDL_Log("Message box thread return %i\n", status);
|
||||
}
|
||||
|
||||
/* Test showing a message box with a parent window */
|
||||
|
@ -166,7 +169,7 @@ main(int argc, char *argv[])
|
|||
"This is a simple error MessageBox with a parent window",
|
||||
window);
|
||||
if (success == -1) {
|
||||
printf("Error Presenting MessageBox: %s\n", SDL_GetError());
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError());
|
||||
quit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue