[foreign-memaccess+abi] RFR: Improve test coverage in the jdk.internal.layout package

Jorn Vernee jvernee at openjdk.org
Tue Feb 14 12:37:09 UTC 2023


On Tue, 14 Feb 2023 12:32:08 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> test/jdk/java/foreign/TestLayouts.java line 80:
>> 
>>> 78:         assertFalse(ADDRESS.equals(differentTargetLayout));
>>> 79:         var equalButNotSame = ADDRESS.withTargetLayout(JAVA_INT).withTargetLayout(JAVA_CHAR);
>>> 80:         assertFalse(ADDRESS.equals(equalButNotSame));
>> 
>> I don't see what this extra code is testing that wasn't already tested by the lines above.
>> 
>> Was this intended as `assertTrue(differentTargetLayout .equals(equalButNotSame));` ?
>
> The idea was to create a layout that is equal but not the same so to touch `OfAddress::equals` at the end where the layouts are compared.

Ok, I get that, but that's not what the test code seems to be doing. i.e. the 2 layouts are not equal, AFAICS

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

PR: https://git.openjdk.org/panama-foreign/pull/790


More information about the panama-dev mailing list