Re: [PATCH v6 6/7] t-reftable-pq: add test for index based comparison

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 25, 2024 at 02:55:58PM +0530, Chandra Pratap wrote:
> @@ -59,9 +56,49 @@ static void t_pq(void)
>  	merged_iter_pqueue_release(&pq);
>  }
>  
> +static void t_pq_index(void)
> +{
> +	struct merged_iter_pqueue pq = { 0 };
> +	struct reftable_record recs[13];
> +	char *last = NULL;
> +	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);

Nit: the `while (i != 1)` should go on the same line as the closing
curly brace.

Patrick

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux