Uploaded image for project: 'Commons Geometry'
  1. Commons Geometry
  2. GEOMETRY-161

use the same EPS values for vector tests

    XMLWordPrintableJSON

Details

    Description

      The test classes Vector1DTest, Vector2DTest, Vector3DTest have EPS variables
      at the beginning of these classes.
      Vector1DTest has double TEST_TOLERANCE = 1e-15,
      Vector2DTest has double EPS = Math.ulp(1d),
      Vector3DTest has double EPS = 1e-15
      I created this variable for my tests in all 3 classes:
      private static final Precision.DoubleEquivalence TEST_PRECISION =Precision.doubleEquivalenceOfEpsilon(EPS);
      I would like to either create a class, like, VectorUtils and put in it the 2 lines:
      static final double EPS = Math.ulp(1d);
      static final Precision.DoubleEquivalence TEST_PRECISION =Precision.doubleEquivalenceOfEpsilon(EPS);
      and use them within the other test classes or create a class, like,
      VectorTestBase or BaseVectorTest that Vector1DTest, Vector2DTest, Vector3DTest will extend and put in VectorTestBase:
      protected final double EPS = Math.ulp(1d);
      protected final Precision.DoubleEquivalence TEST_PRECISION =Precision.doubleEquivalenceOfEpsilon(EPS);

      Attachments

        Activity

          People

            Unassigned Unassigned
            dimitrios.efthymiou Dimitrios Efthymiou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: