RFR: 8313674: java/nio/channels/FileChannel/BlockDeviceSize.java should test for more block devices [v2]

Alan Bateman alanb at openjdk.org
Thu May 2 07:52:54 UTC 2024


On Thu, 2 May 2024 07:22:14 GMT, Inigo Mediavilla Saiz <duke at openjdk.org> wrote:

>> test/jdk/java/nio/channels/FileChannel/BlockDeviceSize.java line 57:
>> 
>>> 55:                 long size1 = ch.size();
>>> 56:                 long size2 = file.length();
>>> 57:                 if (size1 != size2) {
>> 
>> A passing comment on this test is that it just checks that FC::size and RAF::size return the same size. We are sitting on prototype changes that reimplement RAF on FC so it won't be comparing two different implementations if that goes ahead. It will at least test that the size method doesn't throw.
>
> Ok, so if I'm understanding well your comment, it will still make sense to keep this test even if it's only as a validation that the `.size` call won't fail, while the `size1 != size2` will become irrelevant when the changes that you're mentioning get merged.

That's right, the best we can do then is to check that size is >= 0.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19021#discussion_r1587211995


More information about the nio-dev mailing list