git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/9] t/unit-tests: adapt lib-reftable{c,h} helper functions to clar

From
Seyi Chamber <kuforiji98@gmail.com>
Date
Apr 29, 2025, 06:46 UTC
Message-ID
<CAGedMtfwA2vqOFxjLnusvFNcwKpTCLq38bZYBz-9cpzFmbhUdQ@mail.gmail.com>
In-Reply-To
<xmqqa57zamuw.fsf@gitster.g>
On Tue, 29 Apr 2025 at 00:27, Junio C Hamano <gitster@pobox.com> wrote:
Show 34 quoted lines
>
> Seyi Kuforiji <kuforiji98@gmail.com> writes:
>
> > Helper functions defined in `t/unit-tests/lib-reftable.{c,h}` are
> > required for the reftable-related test files to run efficeintly. In the
> > current implementation these functions are designed to conform with our
> > homegrown unit-testing structure. So in other to convert the reftable
> > test files, there is need for a clar specific implementation of these
> > helper functions.
> >
> > type cast `for (size_t i = 0; i < (size_t)stats->ref_stats.blocks; i++)`
> > Adapt functions in lib-reftable.{c,h} to use clar. These functions
> > conform with the clar testing framework and become available for all
> > reftable-related test files implemented using the clar testing
> > framework, which requires them. This will be used by subsequent commits.
> >
> > Signed-off-by: Seyi Kuforiji <kuforiji98@gmail.com>
> > ---
> >  Makefile                    |  4 ++--
> >  t/meson.build               |  4 ++--
> >  t/unit-tests/lib-reftable.c | 26 +++++++++++++-------------
> >  t/unit-tests/lib-reftable.h |  6 +++---
> >  4 files changed, 20 insertions(+), 20 deletions(-)
>
> With this step (and nothing else, as this is the first patch in the
> series) applied to 'master', I see tons of these errors:
>
>     CC t/unit-tests/t-reftable-merged.o
> t/unit-tests/t-reftable-merged.c: In function 'merged_table_from_records':
> t/unit-tests/t-reftable-merged.c:37:17: error: implicit declaration of function 't_reftable_write_to_buf'; did you mean 'cl_reftable_write_to_buf'? [-Wimplicit-function-declaration]
>    37 |                 t_reftable_write_to_buf(&buf[i], refs[i], sizes[i], NULL, 0, &opts);
>       |                 ^~~~~~~~~~~~~~~~~~~~~~~
>       |                 cl_reftable_write_to_buf
>
Hi Junio,

Yes, that is expected, as there are `reftable` test files that depend on the old function names. I navigated this by temporarily porting the functions into the `t/unit-tests/unit-test{c,h}` file to convert the files and moved them back as soon as I was done converting them. Would it be better to leave them in `t/unit-tests/unit-test{c,h}` and then create a final patch that migrates them into the `t/unit-tests/lib-reftable{c,h} file?

Thanks Seyi

Previous: Junio C HamanoNext: Patrick Steinhardt
Message 4 of 14 in “t/unit-tests: convert unit-tests to use clar”
  1. 0/9 t/unit-tests: convert unit-tests to use clarSeyi Kuforiji, Apr 27, 2025
  2. 1/9 t/unit-tests: adapt lib-reftable{c,h} helper functions to clarSeyi Kuforiji, Apr 27, 2025
  3. Junio C HamanoApr 28, 2025
  4. Seyi ChamberApr 29, 2025
  5. Patrick SteinhardtApr 29, 2025
  6. Junio C HamanoApr 29, 2025
  7. 2/9 t/unit-tests: convert reftable basics test to use clar test frameworkSeyi Kuforiji, Apr 27, 2025
  8. 3/9 t/unit-tests: convert reftable block test to use clarSeyi Kuforiji, Apr 27, 2025
  9. 4/9 t/unit-tests: convert reftable merged test to use clarSeyi Kuforiji, Apr 27, 2025
  10. 5/9 t/unit-tests: convert reftable pq test to use clarSeyi Kuforiji, Apr 27, 2025
  11. 6/9 t/unit-tests: convert reftable reader test to use clarSeyi Kuforiji, Apr 27, 2025
  12. 7/9 t/unit-tests: convert reftable readwrite test to use clarSeyi Kuforiji, Apr 27, 2025
  13. 8/9 t/unit-tests: convert reftable record test to use clarSeyi Kuforiji, Apr 27, 2025
  14. 9/9 t/unit-tests: convert reftable stack test to use clarSeyi Kuforiji, Apr 27, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.