aboutsummaryrefslogtreecommitdiffstats
path: root/t/unit-tests
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-10-17 06:53:59 +0200
committerTaylor Blau <me@ttaylorr.com>2024-10-17 16:59:56 -0400
commitf177d491637a3771f19055cb3873bda9c163c91a (patch)
tree1c34bed0a2f4089aa5aabc13f0fd216111c6fdbe /t/unit-tests
parentbe4c070a3c9e7c9d6836c724929ff8a365361e1a (diff)
downloadgit-f177d491637a3771f19055cb3873bda9c163c91a.tar.gz
reftable/blocksource: adapt interface name
Adapt the name of the `strbuf` block source to no longer relate to this interface, but instead to the `reftable_buf` interface. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 't/unit-tests')
-rw-r--r--t/unit-tests/t-reftable-block.c8
-rw-r--r--t/unit-tests/t-reftable-merged.c6
-rw-r--r--t/unit-tests/t-reftable-reader.c4
-rw-r--r--t/unit-tests/t-reftable-readwrite.c24
4 files changed, 21 insertions, 21 deletions
diff --git a/t/unit-tests/t-reftable-block.c b/t/unit-tests/t-reftable-block.c
index 56514b4363..df1d45fe8e 100644
--- a/t/unit-tests/t-reftable-block.c
+++ b/t/unit-tests/t-reftable-block.c
@@ -34,7 +34,7 @@ static void t_ref_block_read_write(void)
REFTABLE_CALLOC_ARRAY(block.data, block_size);
check(block.data != NULL);
block.len = block_size;
- block_source_from_strbuf(&block.source ,&buf);
+ block_source_from_buf(&block.source ,&buf);
ret = block_writer_init(&bw, BLOCK_TYPE_REF, block.data, block_size,
header_off, hash_size(GIT_SHA1_FORMAT_ID));
check(!ret);
@@ -128,7 +128,7 @@ static void t_log_block_read_write(void)
REFTABLE_CALLOC_ARRAY(block.data, block_size);
check(block.data != NULL);
block.len = block_size;
- block_source_from_strbuf(&block.source ,&buf);
+ block_source_from_buf(&block.source ,&buf);
ret = block_writer_init(&bw, BLOCK_TYPE_LOG, block.data, block_size,
header_off, hash_size(GIT_SHA1_FORMAT_ID));
check(!ret);
@@ -218,7 +218,7 @@ static void t_obj_block_read_write(void)
REFTABLE_CALLOC_ARRAY(block.data, block_size);
check(block.data != NULL);
block.len = block_size;
- block_source_from_strbuf(&block.source, &buf);
+ block_source_from_buf(&block.source, &buf);
ret = block_writer_init(&bw, BLOCK_TYPE_OBJ, block.data, block_size,
header_off, hash_size(GIT_SHA1_FORMAT_ID));
check(!ret);
@@ -302,7 +302,7 @@ static void t_index_block_read_write(void)
REFTABLE_CALLOC_ARRAY(block.data, block_size);
check(block.data != NULL);
block.len = block_size;
- block_source_from_strbuf(&block.source, &buf);
+ block_source_from_buf(&block.source, &buf);
ret = block_writer_init(&bw, BLOCK_TYPE_INDEX, block.data, block_size,
header_off, hash_size(GIT_SHA1_FORMAT_ID));
check(!ret);
diff --git a/t/unit-tests/t-reftable-merged.c b/t/unit-tests/t-reftable-merged.c
index 9b0162a4b3..484c18251f 100644
--- a/t/unit-tests/t-reftable-merged.c
+++ b/t/unit-tests/t-reftable-merged.c
@@ -35,7 +35,7 @@ merged_table_from_records(struct reftable_ref_record **refs,
for (size_t i = 0; i < n; i++) {
t_reftable_write_to_buf(&buf[i], refs[i], sizes[i], NULL, 0, &opts);
- block_source_from_strbuf(&(*source)[i], &buf[i]);
+ block_source_from_buf(&(*source)[i], &buf[i]);
err = reftable_reader_new(&(*readers)[i], &(*source)[i],
"name");
@@ -293,7 +293,7 @@ merged_table_from_log_records(struct reftable_log_record **logs,
for (size_t i = 0; i < n; i++) {
t_reftable_write_to_buf(&buf[i], NULL, 0, logs[i], sizes[i], &opts);
- block_source_from_strbuf(&(*source)[i], &buf[i]);
+ block_source_from_buf(&(*source)[i], &buf[i]);
err = reftable_reader_new(&(*readers)[i], &(*source)[i],
"name");
@@ -442,7 +442,7 @@ static void t_default_write_opts(void)
check(!err);
reftable_writer_free(w);
- block_source_from_strbuf(&source, &buf);
+ block_source_from_buf(&source, &buf);
err = reftable_reader_new(&rd, &source, "filename");
check(!err);
diff --git a/t/unit-tests/t-reftable-reader.c b/t/unit-tests/t-reftable-reader.c
index 8a18d7f9be..19cb53b641 100644
--- a/t/unit-tests/t-reftable-reader.c
+++ b/t/unit-tests/t-reftable-reader.c
@@ -20,7 +20,7 @@ static int t_reader_seek_once(void)
int ret;
t_reftable_write_to_buf(&buf, records, ARRAY_SIZE(records), NULL, 0, NULL);
- block_source_from_strbuf(&source, &buf);
+ block_source_from_buf(&source, &buf);
ret = reftable_reader_new(&reader, &source, "name");
check(!ret);
@@ -61,7 +61,7 @@ static int t_reader_reseek(void)
int ret;
t_reftable_write_to_buf(&buf, records, ARRAY_SIZE(records), NULL, 0, NULL);
- block_source_from_strbuf(&source, &buf);
+ block_source_from_buf(&source, &buf);
ret = reftable_reader_new(&reader, &source, "name");
check(!ret);
diff --git a/t/unit-tests/t-reftable-readwrite.c b/t/unit-tests/t-reftable-readwrite.c
index c56a33f1a1..7c7c72bb16 100644
--- a/t/unit-tests/t-reftable-readwrite.c
+++ b/t/unit-tests/t-reftable-readwrite.c
@@ -24,7 +24,7 @@ static void t_buffer(void)
int n;
uint8_t in[] = "hello";
reftable_buf_add(&buf, in, sizeof(in));
- block_source_from_strbuf(&source, &buf);
+ block_source_from_buf(&source, &buf);
check_int(block_source_size(&source), ==, 6);
n = block_source_read_block(&source, &out, 0, sizeof(in));
check_int(n, ==, sizeof(in));
@@ -207,7 +207,7 @@ static void t_log_write_read(void)
reftable_writer_free(w);
w = NULL;
- block_source_from_strbuf(&source, &buf);
+ block_source_from_buf(&source, &buf);
err = reftable_reader_new(&reader, &source, "file.log");
check(!err);
@@ -298,7 +298,7 @@ static void t_log_zlib_corruption(void)
/* corrupt the data. */
buf.buf[50] ^= 0x99;
- block_source_from_strbuf(&source, &buf);
+ block_source_from_buf(&source, &buf);
err = reftable_reader_new(&reader, &source, "file.log");
check(!err);
@@ -328,7 +328,7 @@ static void t_table_read_write_sequential(void)
write_table(&names, &buf, N, 256, GIT_SHA1_FORMAT_ID);
- block_source_from_strbuf(&source, &buf);
+ block_source_from_buf(&source, &buf);
err = reftable_reader_new(&reader, &source, "file.ref");
check(!err);
@@ -380,7 +380,7 @@ static void t_table_read_api(void)
write_table(&names, &buf, N, 256, GIT_SHA1_FORMAT_ID);
- block_source_from_strbuf(&source, &buf);
+ block_source_from_buf(&source, &buf);
err = reftable_reader_new(&reader, &source, "file.ref");
check(!err);
@@ -416,7 +416,7 @@ static void t_table_read_write_seek(int index, int hash_id)
write_table(&names, &buf, N, 256, hash_id);
- block_source_from_strbuf(&source, &buf);
+ block_source_from_buf(&source, &buf);
err = reftable_reader_new(&reader, &source, "file.ref");
check(!err);
@@ -538,7 +538,7 @@ static void t_table_refs_for(int indexed)
reftable_writer_free(w);
w = NULL;
- block_source_from_strbuf(&source, &buf);
+ block_source_from_buf(&source, &buf);
err = reftable_reader_new(&reader, &source, "file.ref");
check(!err);
@@ -600,7 +600,7 @@ static void t_write_empty_table(void)
check_int(buf.len, ==, header_size(1) + footer_size(1));
- block_source_from_strbuf(&source, &buf);
+ block_source_from_buf(&source, &buf);
err = reftable_reader_new(&rd, &source, "filename");
check(!err);
@@ -806,7 +806,7 @@ static void t_write_multiple_indices(void)
check_int(stats->obj_stats.index_offset, >, 0);
check_int(stats->log_stats.index_offset, >, 0);
- block_source_from_strbuf(&source, &writer_buf);
+ block_source_from_buf(&source, &writer_buf);
err = reftable_reader_new(&reader, &source, "filename");
check(!err);
@@ -863,7 +863,7 @@ static void t_write_multi_level_index(void)
stats = reftable_writer_stats(writer);
check_int(stats->ref_stats.max_index_level, ==, 2);
- block_source_from_strbuf(&source, &writer_buf);
+ block_source_from_buf(&source, &writer_buf);
err = reftable_reader_new(&reader, &source, "filename");
check(!err);
@@ -889,7 +889,7 @@ static void t_corrupt_table_empty(void)
struct reftable_reader *reader;
int err;
- block_source_from_strbuf(&source, &buf);
+ block_source_from_buf(&source, &buf);
err = reftable_reader_new(&reader, &source, "file.log");
check_int(err, ==, REFTABLE_FORMAT_ERROR);
}
@@ -903,7 +903,7 @@ static void t_corrupt_table(void)
int err;
reftable_buf_add(&buf, zeros, sizeof(zeros));
- block_source_from_strbuf(&source, &buf);
+ block_source_from_buf(&source, &buf);
err = reftable_reader_new(&reader, &source, "file.log");
check_int(err, ==, REFTABLE_FORMAT_ERROR);