MCPcopy Create free account
hub / github.com/git/git / t_addstr

Function t_addstr

t/unit-tests/u-strbuf.c:80–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80static void t_addstr(struct strbuf *buf, const void *data)
81{
82 const char *text = data;
83 size_t len = strlen(text);
84 size_t orig_alloc = buf->alloc;
85 size_t orig_len = buf->len;
86
87 assert_sane_strbuf(buf);
88 strbuf_addstr(buf, text);
89 assert_sane_strbuf(buf);
90 cl_assert_equal_i(buf->len, orig_len + len);
91 cl_assert(buf->alloc >= orig_alloc);
92 cl_assert(buf->buf[buf->len] == '\0');
93 cl_assert_equal_s(buf->buf + orig_len, text);
94}
95
96void test_strbuf__add_single_char(void)
97{

Callers

nothing calls this directly

Calls 2

assert_sane_strbufFunction · 0.85
strbuf_addstrFunction · 0.85

Tested by

no test coverage detected