summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c3271a9)
raw | patch | inline | side by side (parent: c3271a9)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 28 Nov 2013 16:42:06 +0000 (17:42 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 28 Nov 2013 16:42:06 +0000 (17:42 +0100) |
t/utils/strbuf_test.c | patch | blob | history |
diff --git a/t/utils/strbuf_test.c b/t/utils/strbuf_test.c
index 3a9a5e86e69319b12cb0a3a7384574f912fed6c6..d76c0f20adcdb9556ae8fa6910ea310cdf661ffa 100644 (file)
--- a/t/utils/strbuf_test.c
+++ b/t/utils/strbuf_test.c
n = sdb_strbuf_append(buf, ".");
fail_unless(n == 1, "sdb_strbuf_append() = %zi; expected: 1", n);
+ /* write more bytes; this should trigger at least one more resize but
+ * that's an implementation detail */
+ for (i = 0; i < 1024; ++i) {
+ n = sdb_strbuf_append(buf, ".");
+ fail_unless(n == 1, "sdb_strbuf_append() = %zi; expected: 1", n);
+ }
+
n = (ssize_t)sdb_strbuf_len(buf);
- fail_unless(n == 1024, "sdb_strbuf_len() = %zi; expectd: 1024", n);
+ fail_unless(n == 2048, "sdb_strbuf_len() = %zi; expectd: 2048", n);
}
END_TEST