aboutsummaryrefslogtreecommitdiffstats
path: root/t/unit-tests
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-04-07 15:16:18 +0200
committerJunio C Hamano <gitster@pobox.com>2025-04-07 14:53:10 -0700
commit2b3362c10d39efe09fe9ef16122df3bed5149032 (patch)
tree4f1c5cd562d3fdfce1b6dab6f846aa5c0d541014 /t/unit-tests
parentfd888311fbc95b0cbb3c9e580dc6f7277bb7bf7f (diff)
downloadgit-2b3362c10d39efe09fe9ef16122df3bed5149032.tar.gz
reftable/block: rename `block` to `block_data`
The `reftable_block` structure associates a byte slice with a block source. As such it only holds the data of a reftable block without actually encoding any of the details for how to access that data. Rename the structure to instead be called `reftable_block_data`. Besides clarifying that this really only holds data, it also allows us to rename the `reftable_block_reader` to `reftable_block` in the next commit, as this is the structure that actually encapsulates access to the reftable blocks. Rename the `struct reftable_block_reader::block` member accordingly. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests')
-rw-r--r--t/unit-tests/t-reftable-readwrite.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/t/unit-tests/t-reftable-readwrite.c b/t/unit-tests/t-reftable-readwrite.c
index 3fba888cda..4c49129439 100644
--- a/t/unit-tests/t-reftable-readwrite.c
+++ b/t/unit-tests/t-reftable-readwrite.c
@@ -23,22 +23,22 @@ static void t_buffer(void)
{
struct reftable_buf buf = REFTABLE_BUF_INIT;
struct reftable_block_source source = { 0 };
- struct reftable_block out = { 0 };
+ struct reftable_block_data out = { 0 };
int n;
uint8_t in[] = "hello";
check(!reftable_buf_add(&buf, in, sizeof(in)));
block_source_from_buf(&source, &buf);
check_int(block_source_size(&source), ==, 6);
- n = block_source_read_block(&source, &out, 0, sizeof(in));
+ n = block_source_read_data(&source, &out, 0, sizeof(in));
check_int(n, ==, sizeof(in));
check(!memcmp(in, out.data, n));
- block_source_return_block(&out);
+ block_source_release_data(&out);
- n = block_source_read_block(&source, &out, 1, 2);
+ n = block_source_read_data(&source, &out, 1, 2);
check_int(n, ==, 2);
check(!memcmp(out.data, "el", 2));
- block_source_return_block(&out);
+ block_source_release_data(&out);
block_source_close(&source);
reftable_buf_release(&buf);
}