[Libreoffice-commits] core.git: sc/qa

Laurent Balland-Poirier laurent.balland-poirier at laposte.net
Wed Mar 15 01:21:52 UTC 2017


 sc/qa/unit/ucalc.cxx |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 152e9869f8c32fb2c353bfae22db214eba342507
Author: Laurent Balland-Poirier <laurent.balland-poirier at laposte.net>
Date:   Sun Mar 12 15:17:30 2017 +0100

    tdf#106253 Test Precision as shown for thousand separators
    
    Change-Id: I2e07667884d072a875b7bf5e5c7cf4c3e5d98332
    Reviewed-on: https://gerrit.libreoffice.org/35098
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 86aa877..13d163e 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -6780,14 +6780,17 @@ void Test::testPrecisionAsShown()
         checkPrecisionAsShown( aCode,  fValue,  fExpectedRoundVal );
         checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal );
     }
-    {   // thousand rounding bogus!!!! tdf#106253
+    {   // thousand rounding tdf#106253
         aCode = "0,,";
         fValue = 4.0e9 / 7.0;
-        fExpectedRoundVal = 571e6; // actual is 571428571
-        //checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal );
-        fValue = -4.0e8 / 7.0;
-        fExpectedRoundVal = -57e6; // actual is 57142857
-        //checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal );
+        fExpectedRoundVal = 571e6;
+        checkPrecisionAsShown( aCode,  fValue,  fExpectedRoundVal );
+        checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal );
+        aCode = "\"k\"[$$-409]* #,;[RED]-\"k\"[$$-409]* #,";
+        fValue = 4.0e8 / 7.0;
+        fExpectedRoundVal = 57.143e6;
+        checkPrecisionAsShown( aCode,  fValue,  fExpectedRoundVal );
+        checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal );
     }
     {   // percent rounding
         aCode = "0.00%";


More information about the Libreoffice-commits mailing list