MCPcopy Index your code
hub / github.com/git/git / assert_sane_strbuf

Function assert_sane_strbuf

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

Source from the content-addressed store, hash-verified

28}
29
30static void assert_sane_strbuf(struct strbuf *buf)
31{
32 /* Initialized strbufs should always have a non-NULL buffer */
33 cl_assert(buf->buf != NULL);
34 /* Buffers should always be NUL-terminated */
35 cl_assert(buf->buf[buf->len] == '\0');
36 /*
37 * In case the buffer contains anything, `alloc` must alloc must
38 * be at least one byte larger than `len`.
39 */
40 if (buf->len)
41 cl_assert(buf->len < buf->alloc);
42}
43
44void test_strbuf__static_init(void)
45{

Callers 3

t_addchFunction · 0.85
t_addstrFunction · 0.85

Calls

no outgoing calls

Tested by 1