src/server/test/writer.c

Thu, 15 Aug 2024 22:42:35 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 15 Aug 2024 22:42:35 +0200
changeset 550
77241b3ba544
parent 415
d938228c382e
permissions
-rw-r--r--

add more test_io_http_stream_parse_chunk_header_invalid tests

232
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 /*
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 *
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 * Copyright 2020 Olaf Wintermann. All rights reserved.
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 *
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are met:
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 *
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 *
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 *
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 * POSSIBILITY OF SUCH DAMAGE.
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 */
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29 #include <stdio.h>
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30 #include <stdlib.h>
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32 #include "../util/writer.h"
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33
415
d938228c382e switch from ucx 2 to 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 232
diff changeset
34 #include <cx/buffer.h>
232
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36 #include "writer.h"
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
37 #include "testutils.h"
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
38
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39 UCX_TEST(test_writer_putc) {
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
40 Session *sn = testutil_session();
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
41 TestIOStream *st = testutil_iostream(2048, TRUE);
415
d938228c382e switch from ucx 2 to 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 232
diff changeset
42 CxBuffer *buf = st->buf;
232
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
43
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
44 UCX_TEST_BEGIN;
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
45
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
46 Writer writer;
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
47 char wbuf[1024];
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
48 writer_init(&writer, st, wbuf, 4);
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49 Writer *out = &writer;
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
50
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
51 writer_putc(out, 'a');
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
52 UCX_TEST_ASSERT(wbuf[0] == 'a', "1: wrong char at pos 0");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
53 UCX_TEST_ASSERT(writer.pos == 1, "1: wrong pos");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
54
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
55 writer_putc(out, 'b');
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
56 UCX_TEST_ASSERT(wbuf[1] == 'b', "2: wrong char at pos 1");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
57 UCX_TEST_ASSERT(writer.pos == 2, "2: wrong pos");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
58
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
59 writer_putc(out, 'c');
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
60 writer_putc(out, 'd');
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
61 UCX_TEST_ASSERT(wbuf[2] == 'c', "3: wrong char at pos 2");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62 UCX_TEST_ASSERT(wbuf[3] == 'd', "4: wrong char at pos 3");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
63
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
64 writer_putc(out, 'f'); // should flush the buffer
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 UCX_TEST_ASSERT(wbuf[0] == 'f', "5: wrong char at pos 0");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66 UCX_TEST_ASSERT(writer.pos == 1, "5: wrong pos");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
67 UCX_TEST_ASSERT(buf->space[0] == 'a', "5: wrong char at UcxBuffer pos 0");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
68 UCX_TEST_ASSERT(buf->space[1] == 'b', "5: wrong char at UcxBuffer pos 1");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
69 UCX_TEST_ASSERT(buf->pos == 4, "5: wrong UcxBuffer pos");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
70
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71 UCX_TEST_END;
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
72 testutil_iostream_destroy(st);
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
73 testutil_destroy_session(sn);
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
74 }
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
75
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
76 UCX_TEST(test_writer_flush) {
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
77 Session *sn = testutil_session();
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
78 TestIOStream *st = testutil_iostream(2048, TRUE);
415
d938228c382e switch from ucx 2 to 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 232
diff changeset
79 CxBuffer *buf = st->buf;
232
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
80
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
81 UCX_TEST_BEGIN;
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
82
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
83 Writer writer;
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
84 char wbuf[1024];
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
85 writer_init(&writer, st, wbuf, 4);
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
86 Writer *out = &writer;
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
87
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
88 writer_putc(out, 'a');
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
89 UCX_TEST_ASSERT(wbuf[0] == 'a', "1: wrong char at pos 0");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
90 UCX_TEST_ASSERT(writer.pos == 1, "1: wrong pos");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
91
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
92 writer_flush(out);
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
93 UCX_TEST_ASSERT(writer.pos == 0, "wrong pos after flush");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
94 UCX_TEST_ASSERT(buf->space[0] == 'a', "wrong UcxBuffer content");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
95 UCX_TEST_ASSERT(buf->pos == 1, "wrong UcxBuffer pos");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
96
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
97 writer_putc(out, 'b');
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
98 UCX_TEST_ASSERT(wbuf[0] == 'b', "2: wrong char at pos 0");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
99 UCX_TEST_ASSERT(writer.pos == 1, "2: wrong pos");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
100
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
101 UCX_TEST_END;
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
102 testutil_iostream_destroy(st);
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
103 testutil_destroy_session(sn);
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
104 }
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
105
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
106 UCX_TEST(test_writer_put) {
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
107 Session *sn = testutil_session();
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
108 TestIOStream *st = testutil_iostream(2048, TRUE);
415
d938228c382e switch from ucx 2 to 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 232
diff changeset
109 CxBuffer *buf = st->buf;
232
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
110
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
111 UCX_TEST_BEGIN;
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
112
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
113 Writer writer;
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
114 char wbuf[1024];
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
115 writer_init(&writer, st, wbuf, 8);
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
116 Writer *out = &writer;
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
117
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
118 writer_put(out, "abcd", 4);
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
119 UCX_TEST_ASSERT(!memcmp(wbuf, "abcd", 4), "1: wrong content");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
120 UCX_TEST_ASSERT(writer.pos == 4, "1: wrong pos");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
121
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
122 writer_put(out, "efgh", 4);
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
123 UCX_TEST_ASSERT(!memcmp(wbuf, "abcdefgh", 8), "2: wrong content");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
124 UCX_TEST_ASSERT(writer.pos == 8, "2: wrong pos");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
125
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
126 writer_put(out, "1234", 4);
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
127 UCX_TEST_ASSERT(!memcmp(wbuf, "1234", 4), "3: wrong content");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
128 UCX_TEST_ASSERT(writer.pos == 4, "3: wrong pos");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
129 UCX_TEST_ASSERT(!memcmp(buf->space, "abcdefgh", 8), "3: wrong UcxBuffer content");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
130 UCX_TEST_ASSERT(buf->pos == 8, "3: wrong UcxBuffer pos");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
131
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
132 writer_put(out, "5678xx", 6);
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
133 UCX_TEST_ASSERT(!memcmp(wbuf, "xx", 2), "4: wrong content");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
134 UCX_TEST_ASSERT(writer.pos == 2, "4: wrong pos");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
135 UCX_TEST_ASSERT(!memcmp(buf->space, "abcdefgh12345678", 16), "4: wrong UcxBuffer content");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
136 UCX_TEST_ASSERT(buf->pos == 16, "4: wrong UcxBuffer pos");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
137
415
d938228c382e switch from ucx 2 to 3
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 232
diff changeset
138 writer_puts(out, cx_str("345678abcdefgh12345678end."));
232
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
139 UCX_TEST_ASSERT(!memcmp(wbuf, "end.", 4), "5: wrong content");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
140 UCX_TEST_ASSERT(writer.pos == 4, "5: wrong pos");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
141 UCX_TEST_ASSERT(!memcmp(
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
142 buf->space,
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
143 "abcdefgh12345678xx345678abcdefgh12345678",
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
144 40),
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
145 "5: wrong UcxBuffer content");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
146 UCX_TEST_ASSERT(buf->pos == 40, "5: wrong UcxBuffer pos");
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
147
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
148 UCX_TEST_END;
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
149 testutil_iostream_destroy(st);
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
150 testutil_destroy_session(sn);
499711b2a970 add xml writer
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
151 }

mercurial