1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) Index Data
3 * See the file LICENSE for details.
13 #include <yaz/wrbuf.h>
16 static void tstwrbuf(void)
32 for (step = 1; step < 65; step++)
38 for (j = 1; j<step; j++)
48 YAZ_CHECK(len == step * (step-1) / 2);
50 for (j = 1; j<step; j++)
53 YAZ_CHECK(cp[k] == i+1);
60 wrbuf_puts(wr, "1234");
61 wrbuf_insert(wr, 0, "abc", 3);
62 YAZ_CHECK(!strcmp(wrbuf_cstr(wr), "abc1234"));
65 wrbuf_puts(wr, "1234");
66 wrbuf_insert(wr, 1, "abc", 3);
67 YAZ_CHECK(!strcmp(wrbuf_cstr(wr), "1abc234"));
70 wrbuf_puts(wr, "1234");
71 wrbuf_insert(wr, 4, "abc", 3);
72 YAZ_CHECK(!strcmp(wrbuf_cstr(wr), "1234abc"));
75 wrbuf_puts(wr, "1234");
76 wrbuf_insert(wr, 5, "abc", 3);
77 YAZ_CHECK(!strcmp(wrbuf_cstr(wr), "1234"));
82 int main (int argc, char **argv)
84 YAZ_CHECK_INIT(argc, argv);
92 * c-file-style: "Stroustrup"
93 * indent-tabs-mode: nil
95 * vim: shiftwidth=4 tabstop=8 expandtab