Test resize_and_clear in test_buffer.cpp