summaryrefslogtreecommitdiff
path: root/sal/qa
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-10-14 14:55:23 +0200
committerEike Rathke <erack@redhat.com>2013-10-14 14:57:38 +0200
commitf20feba4c43c34fd2ee05b4658b0de0248c08eb9 (patch)
tree7e31618e4f1ca695eb0eab076b131db7fa6b8ced /sal/qa
parent241454c424b31aa9810b95072122d629fe3a9b8f (diff)
resolved fdo#70319 exponent must be followed by at least one digit
Change-Id: Icdd22fa0f1efcdd18cfea7cb48e1cbf2cf8d3533
Diffstat (limited to 'sal/qa')
-rw-r--r--sal/qa/rtl/math/test-rtl-math.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/sal/qa/rtl/math/test-rtl-math.cxx b/sal/qa/rtl/math/test-rtl-math.cxx
index c156c37b9393..3ebdb157d463 100644
--- a/sal/qa/rtl/math/test-rtl-math.cxx
+++ b/sal/qa/rtl/math/test-rtl-math.cxx
@@ -72,9 +72,21 @@ public:
CPPUNIT_ASSERT_EQUAL(0.0, res);
}
+ void test_stringToDouble_exponent_without_digit() {
+ rtl_math_ConversionStatus status;
+ sal_Int32 end;
+ double res = rtl::math::stringToDouble(
+ rtl::OUString("1e"),
+ sal_Unicode('.'), sal_Unicode(','), &status, &end);
+ CPPUNIT_ASSERT_EQUAL(rtl_math_ConversionStatus_Ok, status);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(RTL_CONSTASCII_LENGTH("1")), end);
+ CPPUNIT_ASSERT_EQUAL(1.0, res);
+ }
+
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(test_stringToDouble_good);
CPPUNIT_TEST(test_stringToDouble_bad);
+ CPPUNIT_TEST(test_stringToDouble_exponent_without_digit);
CPPUNIT_TEST_SUITE_END();
};