t/unit-tests: check for reftable_buf allocation errors

Adapt our unit tests to check for allocations errors.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
This commit is contained in:
Patrick Steinhardt
2024-10-17 06:54:02 +02:00
committed by Taylor Blau
parent f177d49163
commit 31eedd1d11
5 changed files with 44 additions and 44 deletions

View File

@ -113,8 +113,8 @@ int cmd_main(int argc UNUSED, const char *argv[] UNUSED)
};
for (size_t i = 0; i < ARRAY_SIZE(cases); i++) {
reftable_buf_addstr(&a, cases[i].a);
reftable_buf_addstr(&b, cases[i].b);
check(!reftable_buf_addstr(&a, cases[i].a));
check(!reftable_buf_addstr(&b, cases[i].b));
check_int(common_prefix_size(&a, &b), ==, cases[i].want);
reftable_buf_reset(&a);
reftable_buf_reset(&b);