summaryrefslogtreecommitdiff
path: root/t/unit-tests/t-reftable-block.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-10-17 06:54:02 +0200
committerTaylor Blau <me@ttaylorr.com>2024-10-17 16:59:56 -0400
commit31eedd1d115c086a84aaa5b53b14294d0afda4ae (patch)
tree0bc2bc18ff3f26e6be312e30c454db109490c00d /t/unit-tests/t-reftable-block.c
parentf177d491637a3771f19055cb3873bda9c163c91a (diff)
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>
Diffstat (limited to 't/unit-tests/t-reftable-block.c')
-rw-r--r--t/unit-tests/t-reftable-block.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/unit-tests/t-reftable-block.c b/t/unit-tests/t-reftable-block.c
index df1d45fe8e..f9af907117 100644
--- a/t/unit-tests/t-reftable-block.c
+++ b/t/unit-tests/t-reftable-block.c
@@ -167,7 +167,7 @@ static void t_log_block_read_write(void)
for (i = 0; i < N; i++) {
block_iter_reset(&it);
reftable_buf_reset(&want);
- reftable_buf_addstr(&want, recs[i].u.log.refname);
+ check(!reftable_buf_addstr(&want, recs[i].u.log.refname));
ret = block_iter_seek_key(&it, &br, &want);
check_int(ret, ==, 0);
@@ -314,7 +314,7 @@ static void t_index_block_read_write(void)
reftable_buf_init(&recs[i].u.idx.last_key);
recs[i].type = BLOCK_TYPE_INDEX;
- reftable_buf_addstr(&recs[i].u.idx.last_key, buf);
+ check(!reftable_buf_addstr(&recs[i].u.idx.last_key, buf));
recs[i].u.idx.offset = i;
ret = block_writer_add(&bw, &recs[i]);