Pārlūkot izejas kodu

Rename ctkUtilsTest* with a more meaningful name

Julien Finet 14 gadi atpakaļ
vecāks
revīzija
0bf243f8f4

+ 6 - 6
Libs/Core/Testing/Cpp/CMakeLists.txt

@@ -32,11 +32,11 @@ SET(KITTests_SRCS
   ctkErrorLogModelTest2.cpp
   ctkErrorLogModelTest3.cpp
   ctkModelTesterTest1.cpp
+  ctkUtilsClosestPowerOfTenTest1.cpp
+  ctkUtilsOrderOfMagnitudeTest1.cpp
+  ctkUtilsSignificantDecimalsTest1.cpp
   ctkUtilsTest1.cpp
   ctkUtilsTest2.cpp
-  ctkUtilsTest3.cpp
-  ctkUtilsTest4.cpp
-  ctkUtilsTest5.cpp
   ctkDependencyGraphTest1.cpp
   ctkDependencyGraphTest2.cpp
   ctkPimplTest1.cpp
@@ -127,11 +127,11 @@ SET_TESTS_PROPERTIES(ctkErrorLogModelTest3 PROPERTIES PASS_REGULAR_EXPRESSION
 SIMPLE_TEST( ctkModelTesterTest1 )
 SIMPLE_TEST( ctkPimplTest1 )
 SIMPLE_TEST( ctkSingletonTest1 )
+SIMPLE_TEST( ctkUtilsClosestPowerOfTenTest1 )
+SIMPLE_TEST( ctkUtilsOrderOfMagnitudeTest1 )
+SIMPLE_TEST( ctkUtilsSignificantDecimalsTest1 )
 SIMPLE_TEST( ctkUtilsTest1 )
 SIMPLE_TEST( ctkUtilsTest2 )
-SIMPLE_TEST( ctkUtilsTest3 )
-SIMPLE_TEST( ctkUtilsTest4 )
-SIMPLE_TEST( ctkUtilsTest5 )
 SIMPLE_TEST( ctkWorkflowTest1 )
 SIMPLE_TEST( ctkWorkflowTest2 )
 SIMPLE_TEST( ctkWorkflowTest3 )

+ 1 - 1
Libs/Core/Testing/Cpp/ctkUtilsTest5.cpp

@@ -33,7 +33,7 @@
 #include <vector>
 
 //-----------------------------------------------------------------------------
-int ctkUtilsTest5(int , char *  [] )
+int ctkUtilsClosestPowerOfTenTest1(int , char *  [] )
 {
   std::cout.precision(16);
 

+ 1 - 1
Libs/Core/Testing/Cpp/ctkUtilsTest4.cpp

@@ -43,7 +43,7 @@ bool test(double value, int expected)
 }
 
 //-----------------------------------------------------------------------------
-int ctkUtilsTest4(int , char *  [] )
+int ctkUtilsOrderOfMagnitudeTest1(int , char *  [] )
 {
   std::cout.precision(16);
 

+ 1 - 1
Libs/Core/Testing/Cpp/ctkUtilsTest3.cpp

@@ -43,7 +43,7 @@ bool testSignificantDecimals(double value, int expected)
 }
 
 //-----------------------------------------------------------------------------
-int ctkUtilsTest3(int , char *  [] )
+int ctkUtilsSignificantDecimalsTest1(int , char *  [] )
 {
   std::cout.precision(16);
   if (testSignificantDecimals(123456., 0))

+ 6 - 1
Libs/Core/ctkUtils.h

@@ -79,6 +79,9 @@ QRegExp CTK_CORE_EXPORT nameFiltersToRegExp(const QStringList& nameFilters);
 /// Return a "smart" number of decimals needed to display (in a gui) a floating
 /// number.
 /// e.g. significantDecimals(120.01) returns 2
+///      significantDecimals(123456.1333333) returns 3
+///      significantDecimals(123456.26999999999999996) returns 2
+/// See more cases in the test ctkUtilsSignificantDecimalsTest1
 int CTK_CORE_EXPORT significantDecimals(double value);
 
 ///
@@ -91,6 +94,7 @@ int CTK_CORE_EXPORT significantDecimals(double value);
 ///       orderOfMagnitude(0.1) returns -1
 ///       orderOfMagnitude(0.15) returns -1
 ///       orderOfMagnitude(0.) returns NaN
+/// See more cases in the test ctkUtilsOrderOfMagnitudeTest1
 int CTK_CORE_EXPORT orderOfMagnitude(double value);
 
 ///
@@ -100,7 +104,8 @@ int CTK_CORE_EXPORT orderOfMagnitude(double value);
 ///       closestPowerOfTen(-40) returns -10
 ///       closestPowerOfTen(99) returns 100
 ///       closestPowerOfTen(0.012) returns 0.010
-///       orderOfMagnitude(0.)  returns 0
+///       closestPowerOfTen(0.)  returns 0
+/// See more cases in the test ctkUtilsClosestPowerOfTenTest1
 double CTK_CORE_EXPORT closestPowerOfTen(double value);
 
 }