tests/basic_long/Makefile
tests/fork/Makefile
tests/simple_include/Makefile
+ tests/snprintf/Makefile
libmallocwrap/Makefile
libinterfork/Makefile
ustd/Makefile
wsetup.c
libustsnprintf_la_LDFLAGS = -no-undefined -version-info 0:0:0 -static
libustsnprintf_la_CFLAGS = -DUST_COMPONENT="ust_snprintf" -fPIC
-
-check_PROGRAMS = prog
-prog_SOURCES = prog.c
-prog_LDADD = libustsnprintf.la
-TESTS = prog
+++ /dev/null
-#include <stdio.h>
-#include <string.h>
-
-int main()
-{
- char buf[100];
-
- char *expected;
-
- expected = "header 9999, hello, 003";
- ust_safe_snprintf(buf, 99, "header %d, %s, %03d", 9999, "hello", 3);
- if(strcmp(buf, expected) != 0) {
- printf("Error: expected \"%s\" and got \"%s\"\n", expected, buf);
- return 1;
- }
-
- return 0;
-}
-SUBDIRS = hello hello2 basic basic_long fork simple_include
+SUBDIRS = hello hello2 basic basic_long fork simple_include snprintf
--- /dev/null
+check_PROGRAMS = prog
+prog_SOURCES = prog.c
+prog_LDADD = $(top_builddir)/snprintf/libustsnprintf.la
+
+TESTS = prog
--- /dev/null
+#include <stdio.h>
+#include <string.h>
+
+int main()
+{
+ char buf[100];
+
+ char *expected;
+
+ expected = "header 9999, hello, 005, ' 9'";
+ ust_safe_snprintf(buf, 99, "header %d, %s, %03d, '%3$*d'", 9999, "hello", 5, 9);
+ if(strcmp(buf, expected) != 0) {
+ printf("Error: expected \"%s\" and got \"%s\"\n", expected, buf);
+ return 1;
+ }
+
+ return 0;
+}