projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
365cdf7
)
Add test for YAZ-760
author
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 18 Apr 2014 17:45:11 +0000
(19:45 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 18 Apr 2014 17:45:11 +0000
(19:45 +0200)
test/test_wrbuf.c
patch
|
blob
|
history
diff --git
a/test/test_wrbuf.c
b/test/test_wrbuf.c
index
fef37c8
..
a0046ef
100644
(file)
--- a/
test/test_wrbuf.c
+++ b/
test/test_wrbuf.c
@@
-136,10
+136,34
@@
static void tstwrbuf(void)
wrbuf_destroy(wr);
}
wrbuf_destroy(wr);
}
+static void tst_cstr(void)
+{
+ int i;
+ WRBUF w = wrbuf_alloc();
+ for (i = 0; i < 8000; i++)
+ {
+ const char *cp = wrbuf_cstr(w);
+ YAZ_CHECK(strlen(cp) == i);
+ wrbuf_putc(w, 'a');
+ }
+ wrbuf_destroy(w);
+
+ w = wrbuf_alloc();
+ for (i = 0; i < 8000; i++)
+ {
+ const char *cp = wrbuf_cstr(w);
+ YAZ_CHECK(strlen(cp) == i);
+ wrbuf_puts(w, "a");
+ }
+ wrbuf_destroy(w);
+
+}
+
int main (int argc, char **argv)
{
YAZ_CHECK_INIT(argc, argv);
tstwrbuf();
int main (int argc, char **argv)
{
YAZ_CHECK_INIT(argc, argv);
tstwrbuf();
+ tst_cstr();
YAZ_CHECK_TERM;
}
YAZ_CHECK_TERM;
}