diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index ddfa23eefb..d5bcf0748b 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -134,6 +134,7 @@ private slots: void listPatterns(); void measurementSystems(); + void QTBUG_26035_positivesign(); private: QString m_decimal, m_thousand, m_sdate, m_ldate, m_time; @@ -2051,5 +2052,22 @@ void tst_QLocale::measurementSystems() QCOMPARE(locale.measurementSystem(), QLocale::MetricSystem); } +void tst_QLocale::QTBUG_26035_positivesign() +{ + QLocale locale(QLocale::C); + bool ok (false); + QCOMPARE(locale.toInt(QString("+100,000"), &ok), 100000); + QVERIFY(ok); + ok = false; + QCOMPARE(locale.toInt(QString("+100,000,000"), &ok), 100000000); + QVERIFY(ok); + ok = false; + QCOMPARE(locale.toLongLong(QString("+100,000"), &ok), (qlonglong)100000); + QVERIFY(ok); + ok = false; + QCOMPARE(locale.toLongLong(QString("+100,000,000"), &ok), (qlonglong)100000000); + QVERIFY(ok); +} + QTEST_MAIN(tst_QLocale) #include "tst_qlocale.moc" |