RFR (M) 8212959: Remove booleans from tests in vmTestbase
David Holmes
david.holmes at oracle.com
Fri Jan 11 05:34:23 UTC 2019
On 11/01/2019 3:20 pm, JC Beyler wrote:
> Hi David,
>
> Fair enough. I looked a bit to doing it anyway and it is self-contained
> in a lot of cases but a lot of times the work would be greatly
> simplified if we first factorized utility methods across test suites
> first and then (or at the same time) moved them to using bools and not
> doing the explicit tests.
>
> So, except if anyone objects, I'm closing this bug as won't fix and I
> created https://bugs.openjdk.java.net/browse/JDK-8216533 and
> https://bugs.openjdk.java.net/browse/JDK-8216534 for the events/hotswap
> tests which were the most cases of this anyway.
Okay.
> Thanks for the hold up David :-),
Any time :)
Cheers,
David
> Jc
>
> On Tue, Jan 8, 2019 at 11:14 PM David Holmes <david.holmes at oracle.com
> <mailto:david.holmes at oracle.com>> wrote:
>
> On 9/01/2019 4:43 pm, JC Beyler wrote:
> > Hi David,
> >
> > I was not planning on doing it but we could. This change came from a
> > request to remove the booleans from tests for a prior webrev change.
> > I've seen previous conversations about wanting to test explicitly
> > against JNI_TRUE but thought this was a slightly different case.
>
> The basic hotspot style rule is "avoid implicit booleans".
>
> > Basically, from your comment, it seems I could go three ways for
> this
> > change:
> > 1) Not do it and close the bug as won't fix :-)
>
> Certainly the path of least resistance. :)
>
> > 2) Go the extra step and change the various variables being
> tested to
> > bool
> >
> > My preference is to do (2) as much as possible; any case that
> cannot be
> > put in a boolean form without having major changes to the code
> base, I'd
> > leave as is. And then call it a day for this subject.
> >
> > What do you think (ie in cases where the variable can be set to a
> bool,
> > do it and then have the test be an implicit test)?
>
> It's really up to you. It seems a lot of work and I don't know if you
> can actually push this all the way through without needing some
> int<->bool conversion somewhere anyway.
>
> Cheers,
> David
>
> > Thanks!
> > Jc
> >
> > On Tue, Jan 8, 2019 at 10:31 PM David Holmes
> <david.holmes at oracle.com <mailto:david.holmes at oracle.com>
> > <mailto:david.holmes at oracle.com
> <mailto:david.holmes at oracle.com>>> wrote:
> >
> > Hi Jc,
> >
> > On 9/01/2019 4:12 pm, JC Beyler wrote:
> > > Hi all,
> > >
> > > Fixing up the tests in vmTestbase to not be testing explicitly
> > against
> > > NSK_TRUE/NSK_FALSE. Here is the webrev to do that:
> > >
> > > Bug: https://bugs.openjdk.java.net/browse/JDK-8212959
> > > Webrev:
> http://cr.openjdk.java.net/~jcbeyler/8212959/webrev.00/
> >
> > Hold up! We don't do explicit tests when the variable is a
> bool/boolean
> > but when it is an int, as here, we do.
> >
> > Are you planning on converting everything to use bool?
> >
> > Cheers,
> > David
> >
> > > Thanks,
> > > Jc
> >
> >
> >
> > --
> >
> > Thanks,
> > Jc
>
>
>
> --
>
> Thanks,
> Jc
More information about the serviceability-dev
mailing list