diff --git a/cdm/core/src/test/java/ucar/nc2/filter/TestEnhancements.java b/cdm/core/src/test/java/ucar/nc2/filter/TestEnhancements.java index 316340753e..e60a4d29bf 100644 --- a/cdm/core/src/test/java/ucar/nc2/filter/TestEnhancements.java +++ b/cdm/core/src/test/java/ucar/nc2/filter/TestEnhancements.java @@ -79,9 +79,8 @@ public static void setUp() throws IOException, InvalidRangeException { // short data with small scale and offsets Array smallVals = Array.factory(DataType.FLOAT, new int[] {dataLen}, missingData); - builder.addVariable("smallVals", DataType.FLOAT, "dim") - .addAttribute(new Attribute(CDM.SCALE_FACTOR, 1e-12)).addAttribute(new Attribute(CDM.ADD_OFFSET, 1e-12)) - .addAttribute(new Attribute(CDM.FILL_VALUE, 110)); + builder.addVariable("smallVals", DataType.FLOAT, "dim").addAttribute(new Attribute(CDM.SCALE_FACTOR, 1e-12)) + .addAttribute(new Attribute(CDM.ADD_OFFSET, 1e-12)).addAttribute(new Attribute(CDM.FILL_VALUE, 110)); // write data @@ -162,11 +161,12 @@ public void testCombinedEnhancements() throws IOException { Array data = v.read(); assertThat((double[]) data.copyTo1DJavaArray()).isEqualTo(expected); } + @Test public void testConvertMissingWithSmallScaleAndOffset() throws IOException { - Variable v = ncd.findVariable("smallVals"); - Array data = v.read(); - assertThat(Double.isNaN(data.getDouble(2))).isTrue(); - assertThat(Double.isNaN(data.getDouble(1))).isFalse(); + Variable v = ncd.findVariable("smallVals"); + Array data = v.read(); + assertThat(Double.isNaN(data.getDouble(2))).isTrue(); + assertThat(Double.isNaN(data.getDouble(1))).isFalse(); } }