X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftest_wrbuf.c;h=a0046efc28f5d1b1a01e93c8297da46cc2ff1d9a;hb=eb556013557ef8c9e76c52614f88c059ec443c95;hp=fef37c8ace97d6d5ce8a8e5b733a9dfd243abf04;hpb=2d4ac23fdd43c7908123c8dfac739512c9bc8694;p=yaz-moved-to-github.git diff --git a/test/test_wrbuf.c b/test/test_wrbuf.c index fef37c8..a0046ef 100644 --- a/test/test_wrbuf.c +++ b/test/test_wrbuf.c @@ -136,10 +136,34 @@ static void tstwrbuf(void) 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(); + tst_cstr(); YAZ_CHECK_TERM; }