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

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

 



On Wed, Jul 24, 2024 at 09:15:31AM -0700, Junio C Hamano wrote:
> Patrick Steinhardt <ps@xxxxxx> writes:
> 
> > One of those reasons that we use the modulo-loops in the other tests is
> > so that the order in which entries are added is mixed. Here we add them
> > in priority order already, so that makes the test less interesting. We
> > might thus want to do the same here and scramble the order a bit.
> 
> Wouldn't modulo-loops mean the total number of elements must be
> prime with the skip count, or something, which in turn means that it
> is harder to test certain corner cases of the underlying data
> structure (e.g. "what if the length is exactly a power of two?  A
> power of two plus one?  A power of two minus one?"  etc.)
> 
> It certainly is much better than just inserting in the priority
> order (or in the reverse priority order).

Yeah. I am not a huge fan of those modulo-loop as they hide what the
actual test data is myself, but they are already being used in those
tests anyway, and that's why I proposed them. The better option, in my
opinion, is to just make the test data explicit by for example looping
through an array of input data and inserting it one by one.

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