| 28 | } |
| 29 | |
| 30 | static 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 | |
| 44 | void test_strbuf__static_init(void) |
| 45 | { |
no outgoing calls