Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8325659

Normalize Random usage by incubator vector tests

XMLWordPrintable

    • b18

        Our tests (test/jdk/jdk/incubator/vector) now have a number of issues in their approach to use randomisation:

        1. The seed for RNG is taken from a dedicated property, the 'jdk.test.lib.random.seed'. If the property is not set, a default value of 1337 is used. Effectively, that means that by default the tests do always run with the same value, which is unacceptable.

        2. I see no reason against using the standard Utils.getRandomInstance (and @key randomness) there.
        Superficially, the loopopts/superword/TestAlignVectorFuzzer.java presents a nice example.

        3. Many tests create their own ad-hoc RNGs like this:
        > int origin = (new java.util.Random()).nextInt(SPECIES.length());
        > int part = (new java.util.Random()).nextInt(2);
        I suggest to change all those occurrences to use the standard AbstractVectorTest.RAND field. Or Utils.getRandomInstance if the former is not handy enough.

              enikitin Evgeny Nikitin
              enikitin Evgeny Nikitin
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: