X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=test%2Fjalview%2Fschemes%2FAnnotationColourGradientTest.java;h=be8b58dbc4727eb1a8404998c54c285b9ae2cce2;hb=424648b2e57e45eaa21c006b44828d8fca418581;hp=b7a516405bd8f86ca0552d1dec2972f6e29bb095;hpb=985fd5ff517f3eb5221a7aefec88138341514779;p=jalview.git diff --git a/test/jalview/schemes/AnnotationColourGradientTest.java b/test/jalview/schemes/AnnotationColourGradientTest.java index b7a5164..be8b58d 100644 --- a/test/jalview/schemes/AnnotationColourGradientTest.java +++ b/test/jalview/schemes/AnnotationColourGradientTest.java @@ -124,6 +124,18 @@ public class AnnotationColourGradientTest Color result = testee.shadeCalculation(ann, col); assertEquals(result, expected, "for column " + col); } + + /* + * test for boundary case threshold == graphMax (JAL-3206) + */ + float thresh = ann.threshold.value; + ann.threshold.value = ann.graphMax; + Color result = testee.shadeCalculation(ann, WIDTH - 1); + assertEquals(result, maxColour); + testee.setThresholdIsMinMax(false); + result = testee.shadeCalculation(ann, WIDTH - 1); + assertEquals(result, maxColour); + ann.threshold.value = thresh; // reset } /** @@ -174,6 +186,18 @@ public class AnnotationColourGradientTest Color result = testee.shadeCalculation(ann, col); assertEquals(result, expected, "for column " + col); } + + /* + * test for boundary case threshold == graphMin (JAL-3206) + */ + float thresh = ann.threshold.value; + ann.threshold.value = ann.graphMin; + Color result = testee.shadeCalculation(ann, 0); + assertEquals(result, minColour); + testee.setThresholdIsMinMax(false); + result = testee.shadeCalculation(ann, 0); + assertEquals(result, minColour); + ann.threshold.value = thresh; // reset } /**