From: Ben Soares Date: Mon, 22 Apr 2024 16:36:20 +0000 (+0100) Subject: JAL-4397 Allow some leeway in automatically calculated id width tests X-Git-Tag: Release_2_11_4_0~28^2~35^2~4 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=3497a09d63ac5a9dbe4e213dd94ae713430274f4;p=jalview.git JAL-4397 Allow some leeway in automatically calculated id width tests --- diff --git a/test/jalview/gui/AlignmentPanelTest.java b/test/jalview/gui/AlignmentPanelTest.java index d69f57f..c9e4d8c 100644 --- a/test/jalview/gui/AlignmentPanelTest.java +++ b/test/jalview/gui/AlignmentPanelTest.java @@ -311,7 +311,8 @@ public class AlignmentPanelTest int w = af.alignPanel.getVisibleIdWidth(true); int actual = af.alignPanel.getIdPanel().getWidth(); assertEquals(w, actual); - assertEquals(w, 115); + // allow some leeway for different OS renderings + assertTrue(w > 105 && w < 120); // manually adjust af.viewport.setIdWidth(200); @@ -328,6 +329,7 @@ public class AlignmentPanelTest assertEquals(w, actual); af.viewport.setIdWidth(-1); + af.alignPanel.calculateIdWidth(); af.alignPanel.getIdPanel().getIdCanvas().setManuallyAdjusted(false); w = af.alignPanel.calculateIdWidth().width; af.alignPanel.paintComponent(af.alignPanel.getGraphics()); @@ -337,7 +339,8 @@ public class AlignmentPanelTest // setting a negative IdWidth and then running calculateIdWidth resets width // to optimal id width - assertEquals(w, 115); + // allow some leeway for different OS renderings + assertTrue(w > 105 && w < 120); } @Test(groups = "Functional")