975 buf.flags |= CX_BUFFER_AUTO_EXTEND; |
975 buf.flags |= CX_BUFFER_AUTO_EXTEND; |
976 CX_TEST_ASSERT(0 == cxBufferTerminate(&buf)); |
976 CX_TEST_ASSERT(0 == cxBufferTerminate(&buf)); |
977 CX_TEST_ASSERT(buf.size == 8); |
977 CX_TEST_ASSERT(buf.size == 8); |
978 CX_TEST_ASSERT(buf.pos == 8); |
978 CX_TEST_ASSERT(buf.pos == 8); |
979 CX_TEST_ASSERT(buf.capacity > 8); |
979 CX_TEST_ASSERT(buf.capacity > 8); |
980 CX_TEST_ASSERT(0 == memcmp(buf.space, "preptest\0A", 10)); |
980 CX_TEST_ASSERT(0 == memcmp(buf.space, "preptest\0", 9)); |
981 } |
981 } |
982 cxBufferDestroy(&buf); |
982 cxBufferDestroy(&buf); |
983 } |
983 } |
984 |
984 |
985 CX_TEST(test_buffer_write_size_overflow) { |
985 CX_TEST(test_buffer_write_size_overflow) { |