diff options
author | Håvard Pettersen <havardpe@oath.com> | 2018-10-04 09:09:41 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2018-10-09 10:32:04 +0000 |
commit | cfca761ab49212c86407e54b67a53847c68c8518 (patch) | |
tree | d3031b199be90684184bbfb510a1a07bf623df1c /vespalib | |
parent | 2f7a239621a10b15b6a76df9b90636f5855a7fdf (diff) |
test empty smart buffer
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/tests/data/smart_buffer/smart_buffer_test.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vespalib/src/tests/data/smart_buffer/smart_buffer_test.cpp b/vespalib/src/tests/data/smart_buffer/smart_buffer_test.cpp index 360afba091a..fda097a3cfe 100644 --- a/vespalib/src/tests/data/smart_buffer/smart_buffer_test.cpp +++ b/vespalib/src/tests/data/smart_buffer/smart_buffer_test.cpp @@ -130,4 +130,10 @@ TEST("require that buffer can be compacted") { EXPECT_EQUAL(buf.reserve(0).size, 10u); } +TEST("require that a completely empty buffer can be created") { + SmartBuffer buf(0); + EXPECT_EQUAL(buf.capacity(), 0u); + EXPECT_TRUE(buf.obtain().data == nullptr); +} + TEST_MAIN() { TEST_RUN_ALL(); } |