From 3497a09d63ac5a9dbe4e213dd94ae713430274f4 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Mon, 22 Apr 2024 17:36:20 +0100 Subject: [PATCH] JAL-4397 Allow some leeway in automatically calculated id width tests --- test/jalview/gui/AlignmentPanelTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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") -- 1.7.10.2