Add a test for positional parameters in g_snprintf(). Use g_printf()

* tests/string-test.c: Add a test for positional parameters in
	g_snprintf().
	* glib-genmarshal.c, gobject-query.c: Use g_printf() instead of
	system printf.  (#99319)
This commit is contained in:
Matthias Clasen
2002-12-12 23:52:29 +00:00
parent ab5fe79f8a
commit 37e7e80e5b
11 changed files with 135 additions and 90 deletions

View File

@@ -30,6 +30,7 @@
#include <stdio.h>
#include <string.h>
#include "glib.h"
#include "glib/gprintf.h"
int array[10000];
gboolean failed = FALSE;
@@ -226,6 +227,10 @@ main (int argc,
g_assert (g_str_has_suffix("", "xyzzy") == FALSE);
g_assert (g_str_has_suffix("", "") == TRUE);
tmp_string = (gchar *) g_malloc (10);
g_snprintf (tmp_string, 10, "%2$s %1$s", "a", "b");
g_assert (strcmp (tmp_string, "b a") == 0);
return 0;
}