From fb3993cffcd64cf9f9de612bc9147585689931fb Mon Sep 17 00:00:00 2001
From: Karsten Rink <karsten.rink@ufz.de>
Date: Mon, 1 Sep 2014 17:38:29 +0200
Subject: [PATCH] adjusted indentation and comments for tests

---
 Tests/GeoLib/TestBoundingSphere.cpp | 44 ++++++++++++++++++++++++-----
 1 file changed, 37 insertions(+), 7 deletions(-)

diff --git a/Tests/GeoLib/TestBoundingSphere.cpp b/Tests/GeoLib/TestBoundingSphere.cpp
index d98489ce550..96697e9ffe9 100644
--- a/Tests/GeoLib/TestBoundingSphere.cpp
+++ b/Tests/GeoLib/TestBoundingSphere.cpp
@@ -20,9 +20,9 @@
 TEST(GeoLib, TestBoundingSphere)
 {
     GeoLib::Point a(0,  0   ,0);
-	GeoLib::Point b(2,  0   ,0);
-	GeoLib::Point c(1,  0.1 ,0);
-	GeoLib::Point d(1, -0.1 ,0);
+    GeoLib::Point b(2,  0   ,0);
+    GeoLib::Point c(1,  0.1 ,0);
+    GeoLib::Point d(1, -0.1 ,0);
     std::vector<GeoLib::Point*> pnts;
     pnts.push_back(new GeoLib::Point(0,  0   , 0));
     pnts.push_back(new GeoLib::Point(2,  0   , 0));
@@ -30,8 +30,18 @@ TEST(GeoLib, TestBoundingSphere)
     pnts.push_back(new GeoLib::Point(1, -0.1 , 0));
 
     {
+    /**
+     * Four points located like this:
+     *
+     *              *
+     *     *                  *
+     *              *
+     *
+     * Tests if a smaller number of points than available is used if the resulting sphere is smaller.
+     * Expected result is C=(1,0,0), r=1
+     */
     GeoLib::BoundingSphere s(pnts);
-	GeoLib::Point center = s.getCenter();
+    GeoLib::Point center = s.getCenter();
     ASSERT_NEAR(1.0, center[0], std::numeric_limits<double>::epsilon());
     ASSERT_NEAR(0.0, center[1], std::numeric_limits<double>::epsilon());
     ASSERT_NEAR(0.0, center[2], std::numeric_limits<double>::epsilon());
@@ -39,9 +49,21 @@ TEST(GeoLib, TestBoundingSphere)
     }
 
     {
+    /**
+     * Four points located like this:
+     *
+     *          *
+     *    *           *
+     *
+     *
+     *          *
+     *
+     * The smallest sphere has a diameter that is larger than the distance between any two points.
+     * Expected result is C=(1,0.0246,-0.3446), r=1.058
+     */
     (*pnts[2])[2] -= 1.4;
     GeoLib::BoundingSphere s(pnts);
-	GeoLib::Point center = s.getCenter();
+    GeoLib::Point center = s.getCenter();
     ASSERT_NEAR(1.0, center[0], 0.0001);
     ASSERT_NEAR(0.0246, center[1], 0.0001);
     ASSERT_NEAR(-0.3446, center[2], 0.0001);
@@ -58,8 +80,12 @@ TEST(GeoLib, TestBoundingSphere)
     pnts.push_back(new GeoLib::Point(0, 1, 0.9));
 
     {
+    /**
+     * A "cube" where one node is pushed slightly towards the centre (and should be ignored).
+     * Expected result is C=(0.5,0.5,0.5), r=0.866
+     */
     GeoLib::BoundingSphere s(pnts);
-	GeoLib::Point center = s.getCenter();
+    GeoLib::Point center = s.getCenter();
     ASSERT_NEAR(0.5, center[0], std::numeric_limits<double>::epsilon());
     ASSERT_NEAR(0.5, center[1], std::numeric_limits<double>::epsilon());
     ASSERT_NEAR(0.5, center[2], std::numeric_limits<double>::epsilon());
@@ -67,9 +93,13 @@ TEST(GeoLib, TestBoundingSphere)
     }
 
     {
+    /**
+     * A "cube" where one node is pulled away from the centre (making the resulting sphere larger).
+     * Expected result is C=(0.5,0.5,0.6), r=0.9273
+     */
     (*pnts[7])[2] += 0.3;
     GeoLib::BoundingSphere s(pnts);
-	GeoLib::Point center = s.getCenter();
+    GeoLib::Point center = s.getCenter();
     ASSERT_NEAR(0.5, center[0], std::numeric_limits<double>::epsilon());
     ASSERT_NEAR(0.5, center[1], std::numeric_limits<double>::epsilon());
     ASSERT_NEAR(0.6, center[2], std::numeric_limits<double>::epsilon());
-- 
GitLab