]> pd.if.org Git - pdclib/commitdiff
printf_testcases: validate assumptions test cases make (todo soon: add support for...
authorOwen Shepherd <owen.shepherd@e43.eu>
Thu, 16 Aug 2012 12:07:42 +0000 (13:07 +0100)
committerOwen Shepherd <owen.shepherd@e43.eu>
Thu, 16 Aug 2012 12:07:42 +0000 (13:07 +0100)
platform/win32/internals/_PDCLIB_config.h
testing/_PDCLIB_test.h
testing/printf_testcases.h

index c828c7a3b1de50a4538346908a217ae86b85b2a4..27a87b9955b46fa50000c45600f1acbc8d81792b 100644 (file)
@@ -274,10 +274,10 @@ struct _PDCLIB_imaxdiv_t
 
 #ifdef __GNUC__
   typedef char * _PDCLIB_va_list;
-  #define _PDCLIB_va_arg( ap, type ) __builtin_va_arg( ap, type )
-  #define _PDCLIB_va_copy( dest, src ) __builtin_va_copy( dest, src)
-  #define _PDCLIB_va_end( ap ) __builtin_va_end( ap ) 
-  #define _PDCLIB_va_start( ap, parmN ) __builtin_va_start( ap, parmN )
+  #define _PDCLIB_va_arg( ap, type ) (__builtin_va_arg( (ap), type ))
+  #define _PDCLIB_va_copy( dest, src ) (__builtin_va_copy( (dest), (src) ))
+  #define _PDCLIB_va_end( ap ) (__builtin_va_end( ap ) )
+  #define _PDCLIB_va_start( ap, parmN ) (__builtin_va_start( (ap), (parmN) ))
 #else
   #error Compiler support please
 #endif
index 1cb0222a19cc356dc707d7e6292a64112531f2cc..e6d8c3683c6fa29174b05a52d93203bf49e9d772 100644 (file)
@@ -13,6 +13,7 @@
 #include <stdio.h>
 #include <limits.h>
 #include <string.h>
+#include <assert.h>
 
 /* Some strings used for <string.h> and <stdlib.h> testing. */
 static char const abcde[] = "abcde";
index e024784d3c42d136689bdf9206f870e17a5923d1..1f5a7140d3af4c818c4661bc432fc9992df173b7 100644 (file)
@@ -1,5 +1,7 @@
     {
+    assert(CHAR_MIN == -128);
     PRINTF_TEST( 4,   "-128", "%hhd", CHAR_MIN );
+    assert(CHAR_MAX == 127);
     PRINTF_TEST( 3,    "127", "%hhd", CHAR_MAX );
     PRINTF_TEST( 1,      "0", "%hhd", 0 );
     PRINTF_TEST( 6, "-32768",  "%hd", SHRT_MIN );