Usage of Java assertions in JTreg tests?

Alan Bateman Alan.Bateman at oracle.com
Wed Nov 16 14:49:09 UTC 2022


On 16/11/2022 13:48, Volker Simonis wrote:
> :
> Thanks for the info. I usually don't run the tests through the make target.
>
> I think testing would be much more reliable if all the tests which
> depend on Java assertion would explicitly run with assertions  enabled
> (i.e. "@run main/othervm -ea"). Would you agree to such a change?
>
> A lot of tests already do this (e.g. test/jdk/jdk/incubator/vector/)
> but I also found completely useless hotspot tests which rely on
> assertions but by default run without "-ea" even if started from the
> "make test" target (e.g.
> test/hotspot/jtreg/compiler/c2/TestSignExtract.java). They should
> definitely be fixed. If you don't mind, I'll create JBS issues for
> these tasks.
I agree. In the test/jdk tree it may be that some of these are 
oversights and should be changed to assertXXX to align with the other 
assertions in the test.

-Alan


More information about the jdk-dev mailing list