JAL-4154 Update AlignmentPanelTest to use new forArch method
authorMateusz Warowny <mmzwarowny@dundee.ac.uk>
Fri, 24 Mar 2023 15:18:55 +0000 (16:18 +0100)
committerMateusz Warowny <mmzwarowny@dundee.ac.uk>
Fri, 24 Mar 2023 15:18:55 +0000 (16:18 +0100)
test/jalview/gui/AlignmentPanelTest.java

index 2d7e3dc..8cf1c0b 100644 (file)
@@ -41,6 +41,7 @@ import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.SequenceI;
 import jalview.io.DataSourceType;
 import jalview.io.FileLoader;
+import jalview.util.Platform;
 import jalview.viewmodel.ViewportRanges;
 
 public class AlignmentPanelTest
@@ -200,7 +201,7 @@ public class AlignmentPanelTest
      */
     av.setIdWidth(-1); // force recalculation
     d = af.alignPanel.calculateIdWidth();
-    assertEquals(d.width, 166); // 4 + pixel width of "Q93Z60_ARATH/1-118"
+    assertEquals(d.width, Platform.forArch(166).forWin(172).value().intValue()); // 4 + pixel width of "Q93Z60_ARATH/1-118"
     assertEquals(d.height, 12);
     assertEquals(d.width, av.getIdWidth());
   }
@@ -222,7 +223,7 @@ public class AlignmentPanelTest
      * note 4 pixels 'padding' are added to the longest seq name/annotation label
      */
     Dimension d = af.alignPanel.calculateIdWidth(2000);
-    assertEquals(d.width, 166); // 4 + pixel width of "Q93Z60_ARATH/1-118"
+    assertEquals(d.width,  Platform.forArch(166).forWin(172).value().intValue()); // 4 + pixel width of "Q93Z60_ARATH/1-118"
     assertEquals(d.height, 12); // fixed value (not used?)
     assertEquals(av.getIdWidth(), 18); // not changed by this method
 
@@ -233,7 +234,7 @@ public class AlignmentPanelTest
             .findSequenceMatch("Q93Z60_ARATH")[0];
     seq.setName(seq.getName() + "MMMMM");
     d = af.alignPanel.calculateIdWidth(2000);
-    assertEquals(d.width, 211); // 4 + pixel width of "Q93Z60_ARATHMMMMM/1-118"
+    assertEquals(d.width, Platform.forArch(211).forWin(219).value().intValue()); // 4 + pixel width of "Q93Z60_ARATHMMMMM/1-118"
     assertEquals(d.height, 12);
     assertEquals(av.getIdWidth(), 18); // unchanged
 
@@ -269,7 +270,8 @@ public class AlignmentPanelTest
      */
     int w = af.alignPanel.getVisibleIdWidth(true);
     assertEquals(w, af.alignPanel.getIdPanel().getWidth());
-    assertEquals(w, 115);
+    assertEquals(w, Platform.forArch(115).forWin(112).forMac(115)
+            .forLinux(114).value().intValue());
 
     /*
      * width for offscreen rendering is the same
@@ -289,7 +291,9 @@ public class AlignmentPanelTest
      * preference for auto id width overrides fixed width
      */
     Cache.setProperty("FIGURE_AUTOIDWIDTH", Boolean.TRUE.toString());
-    assertEquals(115, af.alignPanel.getVisibleIdWidth(false));
+    assertEquals(af.alignPanel.getVisibleIdWidth(false),
+            Platform.forArch(115).forWin(106).forMac(115).forLinux(114)
+                    .value().intValue());
   }
  
   @Test(groups = "Functional")