843 buf.flags |= CX_BUFFER_AUTO_EXTEND; |
843 buf.flags |= CX_BUFFER_AUTO_EXTEND; |
844 CX_TEST_ASSERT(0 == cxBufferTerminate(&buf)); |
844 CX_TEST_ASSERT(0 == cxBufferTerminate(&buf)); |
845 CX_TEST_ASSERT(buf.size == 8); |
845 CX_TEST_ASSERT(buf.size == 8); |
846 CX_TEST_ASSERT(buf.pos == 8); |
846 CX_TEST_ASSERT(buf.pos == 8); |
847 CX_TEST_ASSERT(buf.capacity > 8); |
847 CX_TEST_ASSERT(buf.capacity > 8); |
848 CX_TEST_ASSERT(0 == memcmp(buf.space, "preptest\0A", 10)); |
848 CX_TEST_ASSERT(0 == memcmp(buf.space, "preptest\0", 9)); |
849 } |
849 } |
850 cxBufferDestroy(&buf); |
850 cxBufferDestroy(&buf); |
851 } |
851 } |
852 |
852 |
853 CX_TEST(test_buffer_write_size_overflow) { |
853 CX_TEST(test_buffer_write_size_overflow) { |