chiark / gitweb /
Placate gcc -flto
[disorder] / libtests / t-printf.c
index 85d1d0179e7efb762bcb9dc36abe992ba0add4d8..d9c22afe2a88288deb70b0c92cadda3a12bf38d1 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
@@ -126,7 +124,7 @@ static void test_printf(void) {
   {
     /* bizarre workaround for compiler checking of format strings */
     char f[] = "xyzzy %";
-    i = byte_asprintf(&cp, f);
+    i = byte_asprintf(&cp, f, 0);
     insist(i == -1);
   }
 
@@ -153,13 +151,13 @@ static void test_printf(void) {
   check_integer(byte_snprintf(buffer, sizeof buffer, L("%zp"), (void *)0), -1);
   check_integer(byte_snprintf(buffer, sizeof buffer, L("%tp"), (void *)0), -1);
   check_integer(byte_snprintf(buffer, sizeof buffer, L("%Lp"), (void *)0), -1);
-  check_integer(byte_snprintf(buffer, sizeof buffer, L("%h%")), -1);
-  check_integer(byte_snprintf(buffer, sizeof buffer, L("%l%")), -1);
-  check_integer(byte_snprintf(buffer, sizeof buffer, L("%q%")), -1);
-  check_integer(byte_snprintf(buffer, sizeof buffer, L("%j%")), -1);
-  check_integer(byte_snprintf(buffer, sizeof buffer, L("%z%")), -1);
-  check_integer(byte_snprintf(buffer, sizeof buffer, L("%t%")), -1);
-  check_integer(byte_snprintf(buffer, sizeof buffer, L("%L%")), -1);
+  check_integer(byte_snprintf(buffer, sizeof buffer, L("%h%"), 0), -1);
+  check_integer(byte_snprintf(buffer, sizeof buffer, L("%l%"), 0), -1);
+  check_integer(byte_snprintf(buffer, sizeof buffer, L("%q%"), 0), -1);
+  check_integer(byte_snprintf(buffer, sizeof buffer, L("%j%"), 0), -1);
+  check_integer(byte_snprintf(buffer, sizeof buffer, L("%z%"), 0), -1);
+  check_integer(byte_snprintf(buffer, sizeof buffer, L("%t%"), 0), -1);
+  check_integer(byte_snprintf(buffer, sizeof buffer, L("%L%"), 0), -1);
   check_integer(byte_snprintf(buffer, sizeof buffer, "%2147483647s%2147483647s", "", ""), -1);
   check_integer(byte_sinkprintf(sink_error(), ""), 0);
   check_integer(byte_sinkprintf(sink_error(), "%5s", ""), -1);