Re: [PATCH v2 1/7] t: move reftable/merged_test.c to the unit testing framework
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Jul 9, 2024, 23:05 UTC
- Message-ID
- <f5j7warzbamijaog6ur6uovr6i7fqwadrjbevnyyocz3orjux4@wugw42cut5oi>
- In-Reply-To
- <20240709053847.4453-2-chandrapratap3519@gmail.com>
On 24/07/09 10:58AM, Chandra Pratap wrote:
Show 12 quoted lines
> reftable/merged_test.c exercises the functions defined in
> reftable/merged.{c, h}. Migrate reftable/merged_test.c to the unit
> testing framework. Migration involves refactoring the tests
> to use the unit testing framework instead of reftable's test
> framework and renaming the tests according to unit-tests' naming
> conventions.
>
> Also, move strbuf_add_void() and noop_flush() from
> reftable/test_framework.c to the ported test. This is because
> both these functions are used in the merged tests and
> reftable/test_framework.{c, h} is not #included in the ported test.
> [snip]
> > -int merged_test_main(int argc, const char *argv[])
Since we are removing this function definition, should we also remove `merged_test_main` from "reftable/reftable-tests.h"?
Show 18 quoted lines
> +int cmd_main(int argc, const char *argv[])
> {
> - RUN_TEST(test_merged_logs);
> - RUN_TEST(test_merged_between);
> - RUN_TEST(test_merged);
> - RUN_TEST(test_default_write_opts);
> - return 0;
> + TEST(t_default_write_opts(), "merged table with default write opts");
> + TEST(t_merged_logs(), "merged table with multiple log updates for same ref");
> + TEST(t_merged_refs(), "merged table with multiple updates to same ref");
> + TEST(t_merged_single_record(), "ref ocurring in only one record can be fetched");
> +
> + return test_done();
> }
> --
> 2.45.2.404.g9eaef5822c
>
>