Unit test for write_to_buf_zlib