[foreign-memaccess+abi] RFR: 8310362: Improve composability of handle derived from layouts
Jorn Vernee
jvernee at openjdk.org
Thu Jun 22 18:03:29 UTC 2023
On Wed, 21 Jun 2023 14:03:58 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> I might have missed something but I did not see tests for the new scale/scaleHandle methods.
I thought about adding tests for this, but it seemed like e.g. a test for `scale` would essentially just be re-creating the implementation in order to validate the behavior. I don't think such a test would be useful.
long offset = layout.scale(baseOffset, index);
assertEquals(offset, baseOffset + (layout.byteSize() * index));
So, I figured it was better to test this functionality indirectly, which we do in a few places (through `scaleHandle`, which also exercises `scale`).
-------------
PR Comment: https://git.openjdk.org/panama-foreign/pull/840#issuecomment-1603095332
More information about the panama-dev
mailing list