From c5acc6ee80d9f429fc8f4d9dd3cca51f3efdf6d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 3 Jun 2009 12:04:56 +0200 Subject: Fixes a crash in QDoubleSpinBox Removing dubious intermediate detection code that also had a buffer overflow. The results were inconsistent and not dependable on. Processing was inefficient and end value to user experience dubious. Test cases that abused the former behaviour were changed to consider input in an Intermediate where it was previously considered Invalid. With this change, user input will mostly be considered in an intermediate state, until it is effectively validated. Task-number: 255019 Reviewed-by: Anders Bakken --- tests/auto/qspinbox/tst_qspinbox.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/auto/qspinbox') diff --git a/tests/auto/qspinbox/tst_qspinbox.cpp b/tests/auto/qspinbox/tst_qspinbox.cpp index 9f00be60d6..79e3ca71e1 100644 --- a/tests/auto/qspinbox/tst_qspinbox.cpp +++ b/tests/auto/qspinbox/tst_qspinbox.cpp @@ -643,21 +643,21 @@ void tst_QSpinBox::valueFromTextAndValidate_data() QTest::addColumn("maxi"); QTest::addColumn("expectedText"); // if empty we don't check - QTest::newRow("data0") << QString("2") << Invalid << 3 << 5 << QString(); + QTest::newRow("data0") << QString("2") << Intermediate << 3 << 5 << QString(); QTest::newRow("data1") << QString() << Intermediate << 0 << 100 << QString(); QTest::newRow("data2") << QString("asd") << Invalid << 0 << 100 << QString(); QTest::newRow("data3") << QString("2") << Acceptable << 0 << 100 << QString(); QTest::newRow("data4") << QString() << Intermediate << 0 << 1 << QString(); QTest::newRow("data5") << QString() << Invalid << 0 << 0 << QString(); QTest::newRow("data5") << QString("5") << Intermediate << 2004 << 2005 << QString(); - QTest::newRow("data6") << QString("50") << Invalid << 2004 << 2005 << QString(); + QTest::newRow("data6") << QString("50") << Intermediate << 2004 << 2005 << QString(); QTest::newRow("data7") << QString("205") << Intermediate << 2004 << 2005 << QString(); QTest::newRow("data8") << QString("2005") << Acceptable << 2004 << 2005 << QString(); - QTest::newRow("data9") << QString("3") << Invalid << 2004 << 2005 << QString(); + QTest::newRow("data9") << QString("3") << Intermediate << 2004 << 2005 << QString(); QTest::newRow("data10") << QString("-") << Intermediate << -20 << -10 << QString(); QTest::newRow("data11") << QString("-1") << Intermediate << -20 << -10 << QString(); QTest::newRow("data12") << QString("-5") << Intermediate << -20 << -10 << QString(); - QTest::newRow("data13") << QString("-5") << Invalid << -20 << -16 << QString(); + QTest::newRow("data13") << QString("-5") << Intermediate << -20 << -16 << QString(); QTest::newRow("data14") << QString("-2") << Intermediate << -20 << -16 << QString(); QTest::newRow("data15") << QString("2") << Invalid << -20 << -16 << QString(); QTest::newRow("data16") << QString() << Intermediate << -20 << -16 << QString(); -- cgit v1.2.3