diff options
| author | Taylor Blau <me@ttaylorr.com> | 2024-10-23 16:21:11 -0400 |
|---|---|---|
| committer | Taylor Blau <me@ttaylorr.com> | 2024-10-23 16:21:11 -0400 |
| commit | 88d21e3176b2f29f34f567ac592e46cbb1d55ec0 (patch) | |
| tree | 8f93047bb0b00377a82021d7ca370ed41849f40f /t/unit-tests/t-reftable-basics.c | |
| parent | fd3785337beb285ed7fd67ce6fc3d3bed2097b40 (diff) | |
| parent | 20590cd287ada9c96efdf804e2bcdac0117c01b8 (diff) | |
Merge branch 'ps/reftable-strbuf' into ps/reftable-detach
* ps/reftable-strbuf:
reftable: handle trivial `reftable_buf` errors
reftable/stack: adapt `stack_filename()` to handle allocation failures
reftable/record: adapt `reftable_record_key()` to handle allocation failures
reftable/stack: adapt `format_name()` to handle allocation failures
t/unit-tests: check for `reftable_buf` allocation errors
reftable/blocksource: adapt interface name
reftable: convert from `strbuf` to `reftable_buf`
reftable/basics: provide new `reftable_buf` interface
reftable: stop using `strbuf_addf()`
reftable: stop using `strbuf_addbuf()`
Diffstat (limited to 't/unit-tests/t-reftable-basics.c')
| -rw-r--r-- | t/unit-tests/t-reftable-basics.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/t/unit-tests/t-reftable-basics.c b/t/unit-tests/t-reftable-basics.c index 1fa77b6faf..a329f55202 100644 --- a/t/unit-tests/t-reftable-basics.c +++ b/t/unit-tests/t-reftable-basics.c @@ -99,8 +99,8 @@ int cmd_main(int argc UNUSED, const char *argv[] UNUSED) } if_test ("common_prefix_size works") { - struct strbuf a = STRBUF_INIT; - struct strbuf b = STRBUF_INIT; + struct reftable_buf a = REFTABLE_BUF_INIT; + struct reftable_buf b = REFTABLE_BUF_INIT; struct { const char *a, *b; int want; @@ -113,14 +113,14 @@ int cmd_main(int argc UNUSED, const char *argv[] UNUSED) }; for (size_t i = 0; i < ARRAY_SIZE(cases); i++) { - strbuf_addstr(&a, cases[i].a); - strbuf_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); - strbuf_reset(&a); - strbuf_reset(&b); + reftable_buf_reset(&a); + reftable_buf_reset(&b); } - strbuf_release(&a); - strbuf_release(&b); + reftable_buf_release(&a); + reftable_buf_release(&b); } if_test ("put_be24 and get_be24 work") { |
