From 35fdbb3a8ea5aa3bc3d49a4ae20141efc76cbd76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Mon, 25 Mar 2024 22:16:39 +0000 Subject: [PATCH 1/2] testSaneUsedFiles: check getCurrentFile is the first file in the getUsedFiles list --- .../src/loci/tests/testng/FormatReaderTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/test-suite/src/loci/tests/testng/FormatReaderTest.java b/components/test-suite/src/loci/tests/testng/FormatReaderTest.java index a7b91ab8b9b..1e58d7ba966 100644 --- a/components/test-suite/src/loci/tests/testng/FormatReaderTest.java +++ b/components/test-suite/src/loci/tests/testng/FormatReaderTest.java @@ -1866,10 +1866,12 @@ public void testSaneUsedFiles() { msg = "Used files list contains duplicates"; } - if (base.length == 1) { - if (!base[0].equals(file)) success = false; + if (!base[0].equals(file)) { + success = false; + msg = "Used files does not start with getCurrentFile"; } - else if (success) { + + if (success) { Arrays.sort(base); IFormatReader r = /*config.noStitching() ? new ImageReader() :*/ new ImageReader(); From 0fc32a5920e1284069152df3705d95b113972e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Sat, 2 Nov 2024 13:34:14 +0000 Subject: [PATCH 2/2] testSaneUsedFiles: exclude readers with getCurrentFile/used file mismatch This approach will allow to incrementally work through each reader and re-include them in the getCurrentFile/getUsedFiles test --- .../src/loci/tests/testng/FormatReaderTest.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/components/test-suite/src/loci/tests/testng/FormatReaderTest.java b/components/test-suite/src/loci/tests/testng/FormatReaderTest.java index 1e58d7ba966..083a940e7cc 100644 --- a/components/test-suite/src/loci/tests/testng/FormatReaderTest.java +++ b/components/test-suite/src/loci/tests/testng/FormatReaderTest.java @@ -1866,9 +1866,19 @@ public void testSaneUsedFiles() { msg = "Used files list contains duplicates"; } - if (!base[0].equals(file)) { + if (!(reader.getFormat().equals("Bio-Rad PIC")) && + !(reader.getFormat().equals("Metamorph STK")) && + !(reader.getFormat().equals("Evotec Flex")) && + !(reader.getFormat().equals("CellSens VSI")) && + !(reader.getFormat().equals("PerkinElmer")) && + !(reader.getFormat().equals("Fuji LAS 3000")) && + !(reader.getFormat().equals("Micro-Manager")) && + !(reader.getFormat().equals("BDV")) && + !(reader.getFormat().equals("Zeiss AxioVision TIFF")) && + !(reader.getFormat().equals("Olympus ScanR")) && + !base[0].equals(file)) { success = false; - msg = "Used files does not start with getCurrentFile"; + msg = "Used files list does not start with getCurrentFile"; } if (success) {