2 * Copyright (C) 2005 by Volker Lendecke
4 * Test harness for sprintf_append
10 int main(int argc
, char *argv
[])
18 mem_ctx
= talloc_init("t_strappend");
19 if (mem_ctx
== NULL
) {
20 fprintf(stderr
, "talloc_init failed\n");
24 sprintf_append(mem_ctx
, &string
, &len
, &bufsize
, "");
25 assert(strlen(string
) == len
);
26 sprintf_append(mem_ctx
, &string
, &len
, &bufsize
, "");
27 assert(strlen(string
) == len
);
28 sprintf_append(mem_ctx
, &string
, &len
, &bufsize
,
29 "01234567890123456789012345678901234567890123456789\n");
30 assert(strlen(string
) == len
);
33 for (i
=0; i
<(100000); i
++) {
35 printf("%d %d\r", i
, bufsize
);
38 sprintf_append(mem_ctx
, &string
, &len
, &bufsize
, "%d\n", i
);
39 assert(strlen(string
) == len
);
42 talloc_destroy(mem_ctx
);