summaryrefslogtreecommitdiff
path: root/test/string-tests.c
diff options
context:
space:
mode:
authorjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2007-07-12 20:37:51 +0000
committerjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2007-07-12 20:37:51 +0000
commit4b7ea28a652a9c63201a064eb24767a9687bf4d5 (patch)
tree69b99ec41ef1ad43807970af0d1e83af6a880a50 /test/string-tests.c
parent7c218ac489ff0e290ff140f34f09f48b9474cd06 (diff)
downloadneon-4b7ea28a652a9c63201a064eb24767a9687bf4d5.tar.gz
* src/ne_string.h (ne_buffer_snprintf): New prototype.
* src/ne_string.c (ne_buffer_snprintf): New function. * test/string-tests.c (buf_print): New test case. git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@1183 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Diffstat (limited to 'test/string-tests.c')
-rw-r--r--test/string-tests.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/test/string-tests.c b/test/string-tests.c
index 9e52789..5f178de 100644
--- a/test/string-tests.c
+++ b/test/string-tests.c
@@ -1,6 +1,6 @@
/*
String handling tests
- Copyright (C) 2001-2006, Joe Orton <joe@manyfish.co.uk>
+ Copyright (C) 2001-2007, Joe Orton <joe@manyfish.co.uk>
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
@@ -594,6 +594,22 @@ static int casencmp(void)
return OK;
}
+static int buf_print(void)
+{
+ ne_buffer *buf = ne_buffer_create();
+
+ ne_buffer_czappend(buf, "foo-");
+ ne_buffer_snprintf(buf, 20, "bar-%s-asda", "norman");
+ ne_buffer_czappend(buf, "-bloo");
+ ONN("snprintf return value", ne_buffer_snprintf(buf, 2, "---") != 1);
+
+ ONCMP(buf->data, "foo-bar-norman-asda-bloo-");
+
+ ne_buffer_destroy(buf);
+
+ return OK;
+}
+
ne_test tests[] = {
T(simple),
@@ -621,6 +637,7 @@ ne_test tests[] = {
T(printing),
T(casecmp),
T(casencmp),
+ T(buf_print),
T(NULL)
};