X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=test%2Fjalview%2Fschemes%2FFeatureColourTest.java;h=7a72c1510ad83ab88b49bc037c157e40dd3c385c;hb=2779b461347e684414f9e98e607e138b1e43db84;hp=03f7efa53de6e402c402800cd1b0c306e3e5ca29;hpb=fb2d7072a283815141262d70d5f11a5e966d500b;p=jalview.git diff --git a/test/jalview/schemes/FeatureColourTest.java b/test/jalview/schemes/FeatureColourTest.java index 03f7efa..7a72c15 100644 --- a/test/jalview/schemes/FeatureColourTest.java +++ b/test/jalview/schemes/FeatureColourTest.java @@ -128,17 +128,28 @@ public class FeatureColourTest 150f); SequenceFeature sf = new SequenceFeature("type", "desc", 0, 20, 70f, null); + + /* + * feature with score of Float.NaN is always assigned minimum colour + */ + SequenceFeature sf2 = new SequenceFeature("type", "desc", 0, 20, + Float.NaN, null); + fc.setThreshold(100f); // ignore for now assertEquals(new Color(204, 204, 204), fc.getColor(sf)); + assertEquals(Color.white, fc.getColor(sf2)); fc.setAboveThreshold(true); // feature lies below threshold assertNull(fc.getColor(sf)); + assertEquals(Color.white, fc.getColor(sf2)); fc.setBelowThreshold(true); fc.setThreshold(70f); assertNull(fc.getColor(sf)); // feature score == threshold - hidden + assertEquals(Color.white, fc.getColor(sf2)); fc.setThreshold(69f); assertNull(fc.getColor(sf)); // feature score > threshold - hidden + assertEquals(Color.white, fc.getColor(sf2)); } /**