Proposal to reuse existing equality testing in unit tests

Doug Simon doug.simon at oracle.com
Tue May 13 20:26:52 UTC 2014


On May 13, 2014, at 7:25 PM, Deneau, Tom <tom.deneau at amd.com> wrote:

> Doug --
> 
> To make it work I had to extend GraalCompilerTest rather than GraalTest (new patch attached).
> Otherwise it didn't do the deep equals for arrays.

You must be not on tip as I moved the necessary methods from GraalCompilerTest to GraalTest.

> But with that, this new patch works for me.  Thanks for noticing this duplication.
> 
> One question, I know we weren't really using it yet but we had made
> an overrideable method that would determine whether two floats or two doubles were equal
> so they wouldn't have to be exactly equal.

> 
> Is there any provision for that in your infrastructure?

Yes. The junit mechanism for this is to supply a ‘delta’ parameter when comparing floats or doubles. I’ve ensured this mechanism is also exposed in the GraalTest API and you can see an example of it being used in FloatDivPrecisionTest once you pull the latest changes:

http://hg.openjdk.java.net/graal/graal/rev/3c1a88470123#l3.9

-Doug

>> -----Original Message-----
>> From: Doug Simon [mailto:doug.simon at oracle.com]
>> Sent: Tuesday, May 13, 2014 10:34 AM
>> To: Deneau, Tom
>> Cc: graal-dev at openjdk.java.net
>> Subject: Proposal to reuse existing equality testing in unit tests
>> 
>> Tom,
>> 
>> I noticed the special logic in KernelTester for comparing results of
>> Okra based executions and sequential executions. As far as I can tell,
>> this duplicates code that already exists in Graal and Junit. Could you
>> please review this patch to remove the redundant logic:
>> 
>> http://cr.openjdk.java.net/~dnsimon/use-existing-equality-testing/
>> 
>> -Doug
> <reuse-existing-equality-testing.patch>



More information about the graal-dev mailing list