From: Eric Sunshine Date: Mon, 23 Feb 2026 14:01:40 GMT Subject: Re: [PATCH 1/4] t/helper: improve "genrandom" test helper Message-ID: In-Reply-To: <20260223-pks-fsck-fix-v1-1-c29036832b6e@pks.im> On Mon, Feb 23, 2026 at 4:51 AM Patrick Steinhardt wrote: > The `test-tool genrandom` test helper can be used to generate random > data, either as an infinite stream or with a specified number of bytes. > The way we handle parsing the number of bytes is lacking though: > > - We don't have good error handling, so if the caller for example uses > `test-tool genrandom 200xyz` then we'll end up generating 200 bytes > of random data successfully. > > - Many callers want to generate e.g. 1 kilobyte or megabyte of data, > but they have to either use unwieldy numbers like 1048576, or they > have to precompute them. > > Fix both of these issues by using `git_parse_ulong()` to parse the > argumemnt. This function has better error handling, and it knows to > handle unit suffixes. s/argumemnt/argument/ > Adapt a couple of our tests to use suffixes instead of manual > computations. > > Signed-off-by: Patrick Steinhardt