From 2b8c3ff0f005221d0ccad612ffa16a5e37b78af0 Mon Sep 17 00:00:00 2001 From: Mikko Knuutila Date: Fri, 11 Nov 2011 14:15:29 +0100 Subject: Added base 10 to be used with QIntValidator. Fixes an error in QIntValidator, which occurred because locale.toInt() was missing a parameter for base value and this led it to presume wrongly that a base 8 is in use. Task-number: QTBUG-21602 Reviewed-by: Friedemann Kleint (cherry picked from commit ee3f763f3642d1a098e6293fbc586b34a3e6e8be) Change-Id: Iee3f763f3642d1a098e6293fbc586b34a3e6e8be --- tests/auto/widgets/widgets/qintvalidator/tst_qintvalidator.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/auto/widgets/widgets') diff --git a/tests/auto/widgets/widgets/qintvalidator/tst_qintvalidator.cpp b/tests/auto/widgets/widgets/qintvalidator/tst_qintvalidator.cpp index 369e3254e8..b7f4bd0061 100644 --- a/tests/auto/widgets/widgets/qintvalidator/tst_qintvalidator.cpp +++ b/tests/auto/widgets/widgets/qintvalidator/tst_qintvalidator.cpp @@ -169,6 +169,15 @@ void tst_QIntValidator::validate_data() QTest::newRow("8.9") << -1 << 100 << QString("5") << ACC; QTest::newRow("8.10") << -1 << 100 << QString("+") << INT; QTest::newRow("8.11") << -1 << 100 << QString("+50") << ACC; + + QTest::newRow("9.0") << -10 << 10 << QString("000") << ACC; + QTest::newRow("9.1") << -10 << 10 << QString("008") << ACC; + QTest::newRow("9.2") << -10 << 10 << QString("-008") << ACC; + QTest::newRow("9.3") << -10 << 10 << QString("00010") << ACC; + QTest::newRow("9.4") << -10 << 10 << QString("-00010") << ACC; + QTest::newRow("9.5") << -10 << 10 << QString("00020") << INV; + QTest::newRow("9.6") << -10 << 10 << QString("-00020") << INV; + } void tst_QIntValidator::validateArabic() -- cgit v1.2.3