RFR: 8269656: The test test/langtools/tools/javac/versions/Versions.java has duplicate test cycles

Joe Darcy darcy at openjdk.java.net
Wed Jul 14 18:13:15 UTC 2021


On Wed, 30 Jun 2021 12:04:07 GMT, Thejasvi Voniadka <tvoniadka at openjdk.org> wrote:

> The test "test test/langtools/tools/javac/versions/Versions.java" duplicates some operations, while missing some others.
> 
> From the execution log:
> 
> ...
> test: check_source_target 52.0 8 8
> ...
> test: check_source_target 52.0 8 8
> ...
> test: check_source_target 53.0 9 9
> ...
> test: check_source_target 53.0 9 9
> ...
> 
> We can notice the duplicates. Also some combinations are missed out. For example, "check -source 7 -target 8" is an expected combination in the output, but it is missed.
> 
> I have updated the index boundaries of the inner for-loop to address this discrepancy.
> 
> In addition, the test code contains an unreachable block of code, that causes the combination "most recent target" without a "-source" specifier to be missed out. I have updated the corresponding "if" condition too.
> 
> I have verified that the test passes on all platforms.

Marked as reviewed by darcy (Reviewer).

test/langtools/tools/javac/versions/Versions.java line 141:

> 139:             boolean dotOne = st.dotOne();
> 140:             check_source_target(dotOne, List.of(classFileVer, target, target));
> 141:             for (int j = i - 1; j >= 0; j--) {

I verified this change removes redundant calls.

test/langtools/tools/javac/versions/Versions.java line 160:

> 158:             }
> 159: 
> 160:             if (i == sourceTargets.length - 1) {

And verified this adds the desired testing.

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

PR: https://git.openjdk.java.net/jdk/pull/4639


More information about the compiler-dev mailing list