Have SDL_ATprint just call SDL_ATprintVerbose. gsoc2009_unit_tests
authorEdgar Simo <bobbens@gmail.com>
Tue, 04 Aug 2009 17:53:20 +0000
branchgsoc2009_unit_tests
changeset 3748 9428ae743878
parent 3747 f7a3a47e6b50
child 3749 1e277c40babe
Have SDL_ATprint just call SDL_ATprintVerbose.
test/automated/SDL_at.c
test/automated/SDL_at.h
--- a/test/automated/SDL_at.c	Tue Aug 04 16:39:15 2009 +0000
+++ b/test/automated/SDL_at.c	Tue Aug 04 17:53:20 2009 +0000
@@ -262,31 +262,6 @@
 
 
 /**
- * @brief Displays a message.
- */
-int SDL_ATprint( const char *msg, ... )
-{
-   va_list ap;
-   int ret;
-
-   /* Only print if not quiet. */
-   if (at_quiet)
-      return 0;
-
-   /* Make sure there is something to print. */
-   if (msg == NULL)
-      return 0;
-   else {
-      va_start(ap, msg);
-      ret = vfprintf( stdout, msg, ap );
-      va_end(ap);
-   }
-
-   return ret;
-}
-
-
-/**
  * @brief Displays a verbose message.
  */
 int SDL_ATprintVerbose( int level, const char *msg, ... )
--- a/test/automated/SDL_at.h	Tue Aug 04 16:39:15 2009 +0000
+++ b/test/automated/SDL_at.h	Tue Aug 04 17:53:20 2009 +0000
@@ -127,10 +127,17 @@
  *    @param msg printf formatted string to display.
  *    @return Number of character printed.
  */
-int SDL_ATprint( const char *msg, ... );
+#define SDL_ATprint(msg, args...) \
+   SDL_ATprintVerbose( 0, msg, ## args)
 /**
  * @brief Prints some verbose text.
  *
+ * Verbosity levels are as follows:
+ *
+ *  - 0 standard stdout, enabled by default
+ *  - 1 additional information
+ *  - 2 detailed information (spammy)
+ *
  *    @param level Level of verbosity to print at.
  *    @param msg printf formatted string to display.
  *    @return Number of character printed.