diff options
Diffstat (limited to 'tests/auto/gui/painting/qcolor/tst_qcolor.cpp')
-rw-r--r-- | tests/auto/gui/painting/qcolor/tst_qcolor.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp index 1b1f5575b1..2e1d55ced4 100644 --- a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp +++ b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp @@ -530,10 +530,19 @@ static const int rgbTblSize = sizeof(rgbTbl) / sizeof(RGBData); void tst_QColor::setNamedColor() { for (int i = 0; i < rgbTblSize; ++i) { - QColor color; - color.setNamedColor(QLatin1String(rgbTbl[i].name)); QColor expected; expected.setRgba(rgbTbl[i].value); + + QColor color; + color.setNamedColor(QLatin1String(rgbTbl[i].name)); + QCOMPARE(color, expected); + + // name should be case insensitive + color.setNamedColor(QString(rgbTbl[i].name).toUpper()); + QCOMPARE(color, expected); + + // spaces should be ignored + color.setNamedColor(QString(rgbTbl[i].name).insert(1, ' ')); QCOMPARE(color, expected); } } |