Re: [PATCH v6 7/7] t-reftable-pq: add tests for merged_iter_pqueue_top()
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jul 30, 2024, 06:04 UTC
- Message-ID
- <ZqiCU_si-bFUgl4a@tanuki>
- In-Reply-To
- <20240725093855.4201-8-chandrapratap3519@gmail.com>
On Thu, Jul 25, 2024 at 02:55:59PM +0530, Chandra Pratap wrote:
Show 27 quoted lines
> @@ -95,10 +104,51 @@ static void t_pq_index(void)
> merged_iter_pqueue_release(&pq);
> }
>
> +static void t_merged_iter_pqueue_top(void)
> +{
> + struct merged_iter_pqueue pq = { 0 };
> + struct reftable_record recs[13];
> + size_t N = ARRAY_SIZE(recs), i;
> +
> + for (i = 0; i < N; i++) {
> + reftable_record_init(&recs[i], BLOCK_TYPE_REF);
> + recs[i].u.ref.refname = (char *) "refs/heads/master";
> + }
> +
> + i = 1;
> + do {
> + struct pq_entry e = {
> + .rec = &recs[i],
> + .index = i,
> + };
> +
> + merged_iter_pqueue_add(&pq, &e);
> + merged_iter_pqueue_check(&pq);
> + i = (i * 7) % N;
> + }
> + while (i != 1);Same nit here. Other than that this patch series looks good to me, thanks!
Patrick