summaryrefslogtreecommitdiff
path: root/src/test/SDL_test_log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/SDL_test_log.c')
-rw-r--r--src/test/SDL_test_log.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/test/SDL_test_log.c b/src/test/SDL_test_log.c
index 4d19012dc0..d184396a30 100644
--- a/src/test/SDL_test_log.c
+++ b/src/test/SDL_test_log.c
@@ -21,11 +21,11 @@
/*
- Used by the test framework and test cases.
+ Used by the test framework and test cases.
*/
-// quiet windows compiler warnings
+/* quiet windows compiler warnings */
#define _CRT_SECURE_NO_WARNINGS
#include "SDL_config.h"
@@ -50,18 +50,18 @@
*
* \return Ascii representation of the timestamp in localtime in the format '08/23/01 14:55:02'
*/
-char *SDLTest_TimestampToString(const time_t timestamp)
+char *SDLTest_TimestampToString(const time_t timestamp)
{
- time_t copy;
- static char buffer[64];
- struct tm *local;
+ time_t copy;
+ static char buffer[64];
+ struct tm *local;
- SDL_memset(buffer, 0, sizeof(buffer));\
- copy = timestamp;
- local = localtime(&copy);
- strftime(buffer, sizeof(buffer), "%x %X", local);
+ SDL_memset(buffer, 0, sizeof(buffer));\
+ copy = timestamp;
+ local = localtime(&copy);
+ strftime(buffer, sizeof(buffer), "%x %X", local);
- return buffer;
+ return buffer;
}
/*
@@ -69,17 +69,17 @@ char *SDLTest_TimestampToString(const time_t timestamp)
*/
void SDLTest_Log(const char *fmt, ...)
{
- va_list list;
- char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH];
+ va_list list;
+ char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH];
- // Print log message into a buffer
- SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH);
- va_start(list, fmt);
- SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, fmt, list);
- va_end(list);
+ /* Print log message into a buffer */
+ SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH);
+ va_start(list, fmt);
+ SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, fmt, list);
+ va_end(list);
- // Log with timestamp and newline
- SDL_LogMessage(SDL_LOG_CATEGORY_TEST, SDL_LOG_PRIORITY_INFO, " %s: %s", SDLTest_TimestampToString(time(0)), logMessage);
+ /* Log with timestamp and newline */
+ SDL_LogMessage(SDL_LOG_CATEGORY_TEST, SDL_LOG_PRIORITY_INFO, " %s: %s", SDLTest_TimestampToString(time(0)), logMessage);
}
/*
@@ -87,15 +87,15 @@ void SDLTest_Log(const char *fmt, ...)
*/
void SDLTest_LogError(const char *fmt, ...)
{
- va_list list;
- char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH];
+ va_list list;
+ char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH];
- // Print log message into a buffer
- SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH);
- va_start(list, fmt);
- SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, fmt, list);
- va_end(list);
+ /* Print log message into a buffer */
+ SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH);
+ va_start(list, fmt);
+ SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, fmt, list);
+ va_end(list);
- // Log with timestamp and newline
- SDL_LogMessage(SDL_LOG_CATEGORY_TEST, SDL_LOG_PRIORITY_ERROR, "%s: %s", SDLTest_TimestampToString(time(0)), logMessage);
+ /* Log with timestamp and newline */
+ SDL_LogMessage(SDL_LOG_CATEGORY_TEST, SDL_LOG_PRIORITY_ERROR, "%s: %s", SDLTest_TimestampToString(time(0)), logMessage);
}