Fix comparison warning in test_buffer