summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/tests/data/smart_buffer/smart_buffer_test.cpp6
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(); }