Index: src/Fragmentation/Exporters/unittests/Makefile.am
===================================================================
--- src/Fragmentation/Exporters/unittests/Makefile.am	(revision 158ecb23722e95bf8861c1420e25dd36d9e8ebaf)
+++ src/Fragmentation/Exporters/unittests/Makefile.am	(revision b67d89f3c210e09d45c1656a8b372c96edc73f25)
@@ -20,5 +20,4 @@
 	SphericalPointDistributionUnitTest
 
-XFAIL_TESTS += SphericalPointDistributionUnitTest
 TESTS += $(FRAGMENTATIONEXPORTERSTESTS)
 check_PROGRAMS += $(FRAGMENTATIONEXPORTERSTESTS) 
Index: src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.cpp
===================================================================
--- src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.cpp	(revision 158ecb23722e95bf8861c1420e25dd36d9e8ebaf)
+++ src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.cpp	(revision b67d89f3c210e09d45c1656a8b372c96edc73f25)
@@ -150,4 +150,100 @@
 }
 
+void perturbPolygon(
+    SphericalPointDistribution::Polygon_t &_polygon,
+    double _amplitude
+    )
+{
+  for (SphericalPointDistribution::Polygon_t::iterator iter = _polygon.begin();
+      iter != _polygon.end(); ++iter) {
+    Vector perturber;
+    perturber.GetOneNormalVector((*iter));
+    perturber.Scale(_amplitude);
+    *iter = *iter + perturber;
+    (*iter).Normalize();
+  }
+}
+
+static
+bool areEqualToWithinBounds(
+    const SphericalPointDistribution::Polygon_t &_polygon,
+    const SphericalPointDistribution::Polygon_t &_otherpolygon,
+    double _amplitude
+    )
+{
+  // same size?
+  if (_polygon.size() != _otherpolygon.size())
+    return false;
+  // same points ? We just check witrh trivial mapping, nothing fancy ...
+  bool status = true;
+  SphericalPointDistribution::Polygon_t::const_iterator iter = _polygon.begin();
+  SphericalPointDistribution::Polygon_t::const_iterator otheriter = _otherpolygon.begin();
+  for (; iter != _polygon.end(); ++iter, ++otheriter) {
+    status &= (*iter - *otheriter).Norm() < _amplitude;
+  }
+  return status;
+}
+
+/** UnitTest for areEqualToWithinBounds()
+ */
+void SphericalPointDistributionTest::areEqualToWithinBoundsTest()
+{
+  // test with no points
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    SphericalPointDistribution::Polygon_t expected = polygon;
+    CPPUNIT_ASSERT( areEqualToWithinBounds(polygon, expected, std::numeric_limits<double>::epsilon()*1e2) );
+  }
+  // test with one point
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon += Vector(1.,0.,0.);
+    SphericalPointDistribution::Polygon_t expected = polygon;
+    CPPUNIT_ASSERT( areEqualToWithinBounds(polygon, expected, std::numeric_limits<double>::epsilon()*1e2) );
+  }
+  // test with two points
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon += Vector(1.,0.,0.);
+    polygon += Vector(0.,1.,0.);
+    SphericalPointDistribution::Polygon_t expected = polygon;
+    CPPUNIT_ASSERT( areEqualToWithinBounds(polygon, expected, std::numeric_limits<double>::epsilon()*1e2) );
+  }
+
+  // test with two points in different order: THIS GOES WRONG: We only check trivially
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon += Vector(1.,0.,0.);
+    polygon += Vector(0.,1.,0.);
+    SphericalPointDistribution::Polygon_t expected;
+    expected += Vector(0.,1.,0.);
+    expected += Vector(1.,0.,0.);
+    CPPUNIT_ASSERT( !areEqualToWithinBounds(polygon, expected, std::numeric_limits<double>::epsilon()*1e2) );
+  }
+
+  // test with two different points
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon += Vector(1.,0.,0.);
+    polygon += Vector(0.,1.,0.);
+    SphericalPointDistribution::Polygon_t expected;
+    expected += Vector(1.01,0.,0.);
+    expected += Vector(0.,1.,0.);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(polygon, expected, 0.05) );
+    CPPUNIT_ASSERT( !areEqualToWithinBounds(polygon, expected, 0.005) );
+  }
+
+  // test with different number of points
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon += Vector(1.,0.,0.);
+    polygon += Vector(0.,1.,0.);
+    SphericalPointDistribution::Polygon_t expected;
+    expected += Vector(0.,1.,0.);
+    CPPUNIT_ASSERT( !areEqualToWithinBounds(polygon, expected, 0.05) );
+  }
+}
+
+
 /** UnitTest for matchSphericalPointDistributions() with three points
  */
@@ -205,4 +301,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 
@@ -227,4 +327,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 
@@ -241,4 +345,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 
@@ -260,4 +368,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 }
@@ -318,4 +430,28 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
+  }
+
+  // test with two points, matching trivially, also with slightly perturbed
+  {
+    SphericalPointDistribution::Polygon_t polygon;
+    polygon += Vector(1.,0.,0.), Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<4>();
+    SphericalPointDistribution::Polygon_t expected = newpolygon;
+    expected.pop_front(); // remove first point
+    expected.pop_front(); // remove second point
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 
@@ -340,4 +476,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 
@@ -360,4 +500,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 
@@ -384,4 +528,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 }
@@ -442,4 +590,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 
@@ -494,4 +646,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 
@@ -518,4 +674,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 }
@@ -576,4 +736,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 
@@ -628,4 +792,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 
@@ -652,4 +820,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 }
@@ -710,4 +882,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 
@@ -762,4 +938,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 
@@ -786,4 +966,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 }
@@ -844,4 +1028,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 
@@ -900,4 +1088,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 
@@ -924,4 +1116,8 @@
             newpolygon);
     CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    // also slightly perturbed
+    const double amplitude = 0.05;
+    perturbPolygon(polygon, amplitude);
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) );
   }
 }
Index: src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.hpp
===================================================================
--- src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.hpp	(revision 158ecb23722e95bf8861c1420e25dd36d9e8ebaf)
+++ src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.hpp	(revision b67d89f3c210e09d45c1656a8b372c96edc73f25)
@@ -22,4 +22,5 @@
 {
     CPPUNIT_TEST_SUITE( SphericalPointDistributionTest) ;
+    CPPUNIT_TEST ( areEqualToWithinBoundsTest );
     CPPUNIT_TEST ( matchSphericalPointDistributionsTest_2 );
     CPPUNIT_TEST ( matchSphericalPointDistributionsTest_3 );
@@ -34,4 +35,5 @@
       void setUp();
       void tearDown();
+      void areEqualToWithinBoundsTest();
       void matchSphericalPointDistributionsTest_2();
       void matchSphericalPointDistributionsTest_3();
