summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-08-20 11:26:23 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-08-20 11:26:23 +0200
commitc65137667b0dc8925bc98e4c64cad6bfde62d40a (patch)
tree5a24d35fd73e10c6a9f7dec8f44f05b112593f30 /tests/unit
parent0ad49d15291ad8c79e62e4491a41266ec0badc60 (diff)
downloadweechat-c65137667b0dc8925bc98e4c64cad6bfde62d40a.zip
tests: improve tests on dynamic strings
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/core/test-string.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit/core/test-string.cpp b/tests/unit/core/test-string.cpp
index a7bc807de..48ee78252 100644
--- a/tests/unit/core/test-string.cpp
+++ b/tests/unit/core/test-string.cpp
@@ -1375,20 +1375,20 @@ TEST(String, Dyn)
POINTERS_EQUAL(NULL, string_dyn_alloc (-1));
POINTERS_EQUAL(NULL, string_dyn_alloc (0));
- str = string_dyn_alloc (1);
+ str = string_dyn_alloc (2);
ptr_string_dyn = (struct t_string_dyn *)str;
CHECK(str);
CHECK(*str);
STRCMP_EQUAL("", *str);
/* check internal structure content */
- LONGS_EQUAL(1, ptr_string_dyn->size_alloc);
+ LONGS_EQUAL(2, ptr_string_dyn->size_alloc);
LONGS_EQUAL(1, ptr_string_dyn->size);
STRCMP_EQUAL("", ptr_string_dyn->string);
/* check copy with NULL */
LONGS_EQUAL(1, string_dyn_copy (str, NULL));
- LONGS_EQUAL(1, ptr_string_dyn->size_alloc);
+ LONGS_EQUAL(2, ptr_string_dyn->size_alloc);
LONGS_EQUAL(1, ptr_string_dyn->size);
POINTERS_EQUAL(ptr_string_dyn->string, *str);
STRCMP_EQUAL("", ptr_string_dyn->string);
@@ -1396,7 +1396,7 @@ TEST(String, Dyn)
/* check copy with an empty string */
LONGS_EQUAL(1, string_dyn_copy (str, ""));
- LONGS_EQUAL(1, ptr_string_dyn->size_alloc);
+ LONGS_EQUAL(2, ptr_string_dyn->size_alloc);
LONGS_EQUAL(1, ptr_string_dyn->size);
POINTERS_EQUAL(ptr_string_dyn->string, *str);
STRCMP_EQUAL("", ptr_string_dyn->string);