diff options
Diffstat (limited to 'src/test/test.c')
-rw-r--r-- | src/test/test.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/test.c b/src/test/test.c index ddfd6337bd..ae423948ec 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -802,6 +802,18 @@ test_buffers(void) buf_free(buf); buf = NULL; + /* Try adding a string too long for any freelist. */ + { + char *cp = tor_malloc_zero(65536); + buf = buf_new(); + write_to_buf(cp, 65536, buf); + tor_free(cp); + + tt_int_op(buf_datalen(buf), ==, 65536); + buf_free(buf); + buf = NULL; + } + done: if (buf) buf_free(buf); |