diff options
| author | Edward Welbourne <edward.welbourne@qt.io> | 2025-08-01 15:38:44 +0200 |
|---|---|---|
| committer | Edward Welbourne <edward.welbourne@qt.io> | 2025-08-04 21:16:14 +0200 |
| commit | cbaaa5a9e19e5fec131e204015e7926f0d3eda4c (patch) | |
| tree | 3a4f808f61e60c2edf5b720d790f5d86aa361c81 | |
| parent | 081062ea5e396d9d251956eee412156f2319b816 (diff) | |
Compare QValidatory::State values as such for better output
QCOMPARE() can handle enums gracefully, so don't cast to int just for
that. Remove some surplus blank lines while I'm here.
Pick-to: 6.10
Change-Id: I0797631dc4f7631e8621ad45ac09f68e9295bca6
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
| -rw-r--r-- | tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp b/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp index e05cfbdb1bc..906194379a3 100644 --- a/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp +++ b/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp @@ -143,7 +143,6 @@ void tst_QIntValidator::validate_data() 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() @@ -156,10 +155,8 @@ void tst_QIntValidator::validateArabic() validator.setLocale(QLocale(QLocale::Arabic, QLocale::SaudiArabia)); int i; QCOMPARE(validator.validate(arabicNum, i), QValidator::Acceptable); - } - void tst_QIntValidator::validateFrench() { QIntValidator validator(-2000, 2000, 0); @@ -200,7 +197,7 @@ void tst_QIntValidator::validate() QIntValidator iv(minimum, maximum, 0); iv.setLocale(QLocale::C); int dummy; - QCOMPARE((int)iv.validate(value, dummy), (int)state); + QCOMPARE(iv.validate(value, dummy), state); } void tst_QIntValidator::notifySignals() |
