git/t/unit-tests
Patrick Steinhardt 7fa7e14ebe reftable: stop using `strbuf_addf()`
We're about to introduce our own `reftable_buf` type to replace
`strbuf`. One function we'll have to convert is `strbuf_addf()`, which
is used in a handful of places. This function uses `snprintf()`
internally, which makes porting it a bit more involved:

  - It is not available on all platforms.

  - Some platforms like Windows have broken implementations.

So by using `snprintf()` we'd also push the burden on downstream users
of the reftable library to make available a properly working version of
it.

Most callsites of `strbuf_addf()` are trivial to convert to not using
it. We do end up using `snprintf()` in our unit tests, but that isn't
much of a problem for downstream users of the reftable library.

While at it, remove a useless call to `strbuf_reset()` in
`t_reftable_stack_auto_compaction_with_locked_tables()`. We don't write
to the buffer before this and initialize it with `STRBUF_INIT`, so there
is no need to reset anything.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2024-10-17 16:59:55 -04:00
..
clar
…
.gitignore
…
clar-generate.awk
…
ctype.c
…
lib-oid.c
…
lib-oid.h
…
lib-reftable.c reftable/writer: handle allocation failures in `reftable_new_writer()` 2024-10-02 07:53:52 -07:00
lib-reftable.h t/unit-tests: introduce reftable library 2024-09-16 13:57:18 -07:00
strvec.c
…
t-example-decorate.c
…
t-hash.c
…
t-hashmap.c
…
t-mem-pool.c
…
t-oid-array.c
…
t-oidmap.c
…
t-oidtree.c
…
t-prio-queue.c
…
t-reftable-basics.c reftable/basics: handle allocation failures in `parse_names()` 2024-10-02 07:53:51 -07:00
t-reftable-block.c reftable: stop using `strbuf_addf()` 2024-10-17 16:59:55 -04:00
t-reftable-merged.c reftable: handle trivial allocation failures 2024-10-02 07:53:55 -07:00
t-reftable-pq.c
…
t-reftable-reader.c reftable/reader: make table iterator reseekable 2024-09-16 13:57:19 -07:00
t-reftable-readwrite.c reftable: stop using `strbuf_addf()` 2024-10-17 16:59:55 -04:00
t-reftable-record.c
…
t-reftable-stack.c reftable: stop using `strbuf_addf()` 2024-10-17 16:59:55 -04:00
t-reftable-tree.c reftable/tree: handle allocation failures 2024-10-02 07:53:55 -07:00
t-strbuf.c
…
t-strcmp-offset.c
…
t-trailer.c
…
t-urlmatch-normalization.c
…
test-lib.c
…
test-lib.h
…
unit-test.c
…
unit-test.h
…