X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fschemes%2FFeatureColourTest.java;h=7a72c1510ad83ab88b49bc037c157e40dd3c385c;hb=2066caec85bf0b332d924472fcfdbdaa07f56f1e;hp=03f7efa53de6e402c402800cd1b0c306e3e5ca29;hpb=9be780bb5fbda5e607cfaa010c1fd3f52510ea3a;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)); } /**