From d831ce11612bd944af46456182c28a758d833689 Mon Sep 17 00:00:00 2001 From: Saikat Chakraborty Date: Fri, 23 Aug 2024 16:57:19 +0000 Subject: [PATCH] Add a test that specifically test the expansion of the memory in string_buffer. --- src/test/string_buffer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/string_buffer.cpp b/src/test/string_buffer.cpp index b3e3ce79d..6843f2e91 100644 --- a/src/test/string_buffer.cpp +++ b/src/test/string_buffer.cpp @@ -45,8 +45,18 @@ static void tst3() { ENSURE(strcmp(b.c_str(), "Hello World") == 0); } +static void tst_small_buffer_expand(){ + string_buffer<4> b; + b << "Hello"; + ENSURE(strcmp(b.c_str(), "Hello") == 0); + + b << " World"; + ENSURE(strcmp(b.c_str(), "Hello World") == 0); +} + void tst_string_buffer() { tst1(); tst2(); tst3(); + tst_small_buffer_expand(); }