sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1766739 - /sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/NTv2Test.java
Date Wed, 26 Oct 2016 21:28:59 GMT
Author: desruisseaux
Date: Wed Oct 26 21:28:58 2016
New Revision: 1766739

URL: http://svn.apache.org/viewvc?rev=1766739&view=rev
Log:
Use StrictMath instead of Math in tests as a matter of principle.

Modified:
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/NTv2Test.java

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/NTv2Test.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/NTv2Test.java?rev=1766739&r1=1766738&r2=1766739&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/NTv2Test.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/NTv2Test.java
[UTF-8] Wed Oct 26 21:28:58 2016
@@ -92,7 +92,7 @@ public final strictfp class NTv2Test ext
      * because Apache SIS does not redistribute the {@code "NTF_R93.gsb"}. But developers
can invoke this method
      * explicitely if they can provide a path to the {@code "NTF_R93.gsb"} file.
      *
-     * @param  file Path to the official {@code "NTF_R93.gsb"} file.
+     * @param  file  path to the official {@code "NTF_R93.gsb"} file.
      * @throws IOException if an error occurred while loading the grid.
      * @throws FactoryException if an error occurred while computing the grid.
      * @throws TransformException if an error occurred while computing the envelope or testing
the point.
@@ -104,10 +104,10 @@ public final strictfp class NTv2Test ext
     /**
      * Implementation of {@link #testLoader()} and {@link #testRGF93(Path)}.
      *
-     * @param xmin Negative of value of {@code "W_LONG"} record.
-     * @param xmax Negative of value of {@code "E_LONG"} record.
-     * @param ymin Value of the {@code "S_LAT"} record.
-     * @param ymax Value of the {@code "N_LAT"} record.
+     * @param  xmin  negative of value of {@code "W_LONG"} record.
+     * @param  xmax  negative of value of {@code "E_LONG"} record.
+     * @param  ymin  value of the {@code "S_LAT"} record.
+     * @param  ymax  value of the {@code "N_LAT"} record.
      */
     private static void testRGF93(final Path file, final double xmin, final double xmax,
             final double ymin, final double ymax) throws IOException, FactoryException, TransformException
@@ -198,12 +198,12 @@ public final strictfp class NTv2Test ext
      * is rounding errors. This is usually the case when using the {@code "SECONDS"} unit
of measurement.
      * This assumption does not apply to the shift values.
      *
-     * @param grid  The full grid from which to extract a few values.
-     * @param out   Where to write the test file.
-     * @param gridX Index along the longitude axis of the first cell to write.
-     * @param gridY Index along the latitude axis of the first cell to write.
-     * @param nx    Number of cells to write along the longitude axis.
-     * @param ny    Number of cells to write along the latitude axis.
+     * @param  grid   the full grid from which to extract a few values.
+     * @param  out    where to write the test file.
+     * @param  gridX  index along the longitude axis of the first cell to write.
+     * @param  gridY  index along the latitude axis of the first cell to write.
+     * @param  nx     number of cells to write along the longitude axis.
+     * @param  ny     number of cells to write along the latitude axis.
      * @throws TransformException if an error occurred while computing the envelope.
      * @throws IOException if an error occurred while writing the test file.
      */
@@ -219,12 +219,12 @@ public final strictfp class NTv2Test ext
         writeString(buffer, "NUM_FILE"); buffer.putInt(1); nextRecord(buffer);
         writeString(buffer, "GS_TYPE");  writeString(buffer, "SECONDS");
         writeString(buffer, "VERSION");  writeString(buffer, "SIS_TEST");   // Last overview
record.
-        writeString(buffer, "S_LAT");    buffer.putDouble(Math.rint( envelope.getMinimum(1)));
-        writeString(buffer, "N_LAT");    buffer.putDouble(Math.rint( envelope.getMaximum(1)));
-        writeString(buffer, "E_LONG");   buffer.putDouble(Math.rint(-envelope.getMaximum(0)));
 // Sign reversed.
-        writeString(buffer, "W_LONG");   buffer.putDouble(Math.rint(-envelope.getMinimum(0)));
-        writeString(buffer, "LAT_INC");  buffer.putDouble(Math.rint( envelope.getSpan(1)
/ (ny - 1)));
-        writeString(buffer, "LONG_INC"); buffer.putDouble(Math.rint( envelope.getSpan(0)
/ (nx - 1)));
+        writeString(buffer, "S_LAT");    buffer.putDouble(StrictMath.rint( envelope.getMinimum(1)));
+        writeString(buffer, "N_LAT");    buffer.putDouble(StrictMath.rint( envelope.getMaximum(1)));
+        writeString(buffer, "E_LONG");   buffer.putDouble(StrictMath.rint(-envelope.getMaximum(0)));
 // Sign reversed.
+        writeString(buffer, "W_LONG");   buffer.putDouble(StrictMath.rint(-envelope.getMinimum(0)));
+        writeString(buffer, "LAT_INC");  buffer.putDouble(StrictMath.rint( envelope.getSpan(1)
/ (ny - 1)));
+        writeString(buffer, "LONG_INC"); buffer.putDouble(StrictMath.rint( envelope.getSpan(0)
/ (nx - 1)));
         writeString(buffer, "GS_COUNT"); buffer.putInt(nx * ny); nextRecord(buffer);
         for (int y=0; y<ny; y++) {
             for (int x=0; x<nx; x++) {



Mime
View raw message