Some corner case unit tests
Change-Id: I43474265a9b3e1d07394c5f7e429e081d67f2eda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122935
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/sal/qa/rtl/math/test-rtl-math.cxx b/sal/qa/rtl/math/test-rtl-math.cxx
index 3067e11..aaadccc8 100644
--- a/sal/qa/rtl/math/test-rtl-math.cxx
+++ b/sal/qa/rtl/math/test-rtl-math.cxx
@@ -469,6 +469,18 @@ public:
fVal = 123456.789;
aRes = rtl::math::doubleToUString(fVal, rtl_math_StringFormat_E, 2, '.', false);
CPPUNIT_ASSERT_EQUAL(OUString("1.23E+005"), aRes);
// Testing "after-treatment of up-rounding to the next decade" branch
// See void doubleToString in sal/rtl/math.cxx
// 1. Yet empty buffer
fVal = 9.9999999999999929;
aRes = rtl::math::doubleToUString(fVal, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, '.', true);
CPPUNIT_ASSERT_EQUAL(OUString("10"), aRes);
// 2. Buffer with some content
fVal = 0.99999999999999933;
aRes = rtl::math::doubleToUString(fVal, rtl_math_StringFormat_F, rtl_math_DecimalPlaces_Max, '.', true);
CPPUNIT_ASSERT_EQUAL(OUString("1"), aRes);
}
void test_approx() {