Correct PPTP server firewall rules chain.
[tomato/davidwu.git] / release / src / router / nettle / testsuite / buffer-test.c
blobfe2e22243ff4123402a49a14213be4fae129877a
1 #include "testutils.h"
2 #include "buffer.h"
4 void
5 test_main(void)
7 struct nettle_buffer buffer;
8 uint8_t s[5];
10 nettle_buffer_init(&buffer);
11 ASSERT(nettle_buffer_write(&buffer, LDATA("foo")));
13 ASSERT(NETTLE_BUFFER_PUTC(&buffer, 'x'));
15 ASSERT(buffer.size == 4);
16 ASSERT(buffer.alloc >= 4);
17 ASSERT(MEMEQ(4, buffer.contents, "foox"));
19 nettle_buffer_clear(&buffer);
21 nettle_buffer_init_size(&buffer, sizeof(s), s);
22 ASSERT(buffer.alloc == sizeof(s));
23 ASSERT(nettle_buffer_write(&buffer, LDATA("foo")));
24 ASSERT(buffer.size == 3);
26 ASSERT(!nettle_buffer_write(&buffer, LDATA("bar")));