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

Function t_addch

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

Source from the content-addressed store, hash-verified

63}
64
65static void t_addch(struct strbuf *buf, const void *data)
66{
67 const char *p_ch = data;
68 const char ch = *p_ch;
69 size_t orig_alloc = buf->alloc;
70 size_t orig_len = buf->len;
71
72 assert_sane_strbuf(buf);
73 strbuf_addch(buf, ch);
74 assert_sane_strbuf(buf);
75 cl_assert_equal_i(buf->len, orig_len + 1);
76 cl_assert(buf->alloc >= orig_alloc);
77 cl_assert(buf->buf[buf->len] == '\0');
78}
79
80static void t_addstr(struct strbuf *buf, const void *data)
81{

Callers

nothing calls this directly

Calls 2

assert_sane_strbufFunction · 0.85
strbuf_addchFunction · 0.85

Tested by

no test coverage detected