summaryrefslogtreecommitdiffstats
path: root/ctdb/lib/replace/test/snprintf.c
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2014-05-16 00:04:35 +1000
committerMichael Adam <obnox@samba.org>2014-06-20 23:38:09 +0200
commit91274d97a644ece172ad99937967cec3d7258b0e (patch)
tree1c1ab78aa1fd026cc2adae9450e8e56bccc98d5c /ctdb/lib/replace/test/snprintf.c
parent1e927a93224549fa9464fb0dc2fc69941483a76c (diff)
downloadsamba-91274d97a644ece172ad99937967cec3d7258b0e.tar.gz
samba-91274d97a644ece172ad99937967cec3d7258b0e.tar.xz
samba-91274d97a644ece172ad99937967cec3d7258b0e.zip
ctdb-build: Remove duplicate replace library
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'ctdb/lib/replace/test/snprintf.c')
-rw-r--r--ctdb/lib/replace/test/snprintf.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/ctdb/lib/replace/test/snprintf.c b/ctdb/lib/replace/test/snprintf.c
deleted file mode 100644
index d06630bcc9..0000000000
--- a/ctdb/lib/replace/test/snprintf.c
+++ /dev/null
@@ -1,29 +0,0 @@
-void foo(const char *format, ...)
-{
- va_list ap;
- int len;
- char buf[20];
- long long l = 1234567890;
- l *= 100;
-
- va_start(ap, format);
- len = vsnprintf(buf, 0, format, ap);
- va_end(ap);
- if (len != 5) exit(1);
-
- va_start(ap, format);
- len = vsnprintf(0, 0, format, ap);
- va_end(ap);
- if (len != 5) exit(2);
-
- if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(3);
-
- if (snprintf(buf, 20, "%lld", l) != 12 || strcmp(buf, "123456789000") != 0) exit(4);
- if (snprintf(buf, 20, "%zu", 123456789) != 9 || strcmp(buf, "123456789") != 0) exit(5);
- if (snprintf(buf, 20, "%2\$d %1\$d", 3, 4) != 3 || strcmp(buf, "4 3") != 0) exit(6);
- if (snprintf(buf, 20, "%s", 0) < 3) exit(7);
-
- printf("1");
- exit(0);
-}
-main() { foo("hello"); }