RFR: 8346107: Generators: testing utility for random value generation [v17]

Emanuel Peter epeter at openjdk.org
Tue Jan 14 16:37:12 UTC 2025


On Tue, 14 Jan 2025 16:31:02 GMT, Theo Weidmann <tweidmann at openjdk.org> wrote:

>> test/hotspot/jtreg/compiler/lib/generators/Generators.java line 281:
>> 
>>> 279:      * values as powers of two.
>>> 280:      */
>>> 281:     public RestrictableGenerator<Integer> specialInts(int range) {
>> 
>> IIUC, this will generate MIN and MAX and values around them but only with `range = 31`. Would it make sense to have a separate method that creates a generator with values including MIN, MAX, zero and values around them? We could also combine them with some power of twos. When calling this new method `specialInts`, we could rename this method to `powerOfTwos` or something like that. This might make it easier to understand the intent.
>> 
>> Same for longs.
>
> Min and max are in the set for range >= 1. But I agree that I would make sense to rename it to `powersOfTwo`. @eme64 What do you think?

@theoweidmannoracle sounds fine to me.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/22941#discussion_r1915200678


More information about the hotspot-compiler-dev mailing list