summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui')
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp31
-rw-r--r--tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp80
-rw-r--r--tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp12
-rw-r--r--tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp2
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp1
-rw-r--r--tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp4
-rw-r--r--tests/auto/gui/painting/qpen/tst_qpen.cpp4
-rw-r--r--tests/auto/gui/text/qfont/qfont.pro1
-rw-r--r--tests/auto/gui/text/qfont/tst_qfont.cpp43
-rw-r--r--tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp16
-rw-r--r--tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp13
11 files changed, 115 insertions, 92 deletions
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
index dd6d97043d..1918841d24 100644
--- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
@@ -109,7 +109,6 @@ private slots:
void setGetMask();
void cacheKey();
void drawBitmap();
- void grabWindow();
void isNull();
void task_246446();
@@ -723,36 +722,6 @@ void tst_QPixmap::drawBitmap()
QVERIFY(lenientCompare(pixmap, expected));
}
-void tst_QPixmap::grabWindow()
-{
-// ### fixme: Check platforms
- QSKIP("QTBUG-20863 grabWindow is broken on most qpa backends");
-#ifndef QT_NO_WIDGETS
-#ifdef Q_OS_WINCE
- // We get out of memory, if the desktop itself is too big.
- if (QApplication::desktop()->width() <= 480)
-#endif
- QVERIFY(QPixmap::grabWindow(QApplication::desktop()->winId()).isNull() == false);
- QWidget w;
- w.resize(640, 480);
- w.show();
- QVERIFY(QTest::qWaitForWindowExposed(&w));
- QVERIFY(QPixmap::grabWindow(w.winId()).isNull() == false);
-
- QWidget child(&w);
- child.setGeometry(50, 50, 100, 100);
- child.setPalette(Qt::red);
- child.setAutoFillBackground(true);
- child.show();
- QTest::qWait(20);
- const QPixmap grabWidgetPixmap = child.grab();
- const WId childWinId = child.winId(); // Create native child
- QVERIFY(QTest::qWaitForWindowExposed(child.windowHandle()));
- const QPixmap grabWindowPixmap = QPixmap::grabWindow(childWinId);
- QVERIFY(lenientCompare(grabWindowPixmap, grabWidgetPixmap));
-#endif
-}
-
void tst_QPixmap::isNull()
{
{
diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
index acb6ce8ef6..d28e4298b4 100644
--- a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
+++ b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
@@ -183,23 +183,23 @@ void tst_QStandardItemModel::init()
qRegisterMetaType<Qt::Orientation>("Qt::Orientation");
m_model = new QStandardItemModel(defaultSize, defaultSize);
- connect(m_model, SIGNAL(rowsAboutToBeInserted(QModelIndex, int, int)),
- this, SLOT(rowsAboutToBeInserted(QModelIndex, int, int)));
- connect(m_model, SIGNAL(rowsInserted(QModelIndex, int, int)),
- this, SLOT(rowsInserted(QModelIndex, int, int)));
- connect(m_model, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)),
- this, SLOT(rowsAboutToBeRemoved(QModelIndex, int, int)));
- connect(m_model, SIGNAL(rowsRemoved(QModelIndex, int, int)),
- this, SLOT(rowsRemoved(QModelIndex, int, int)));
-
- connect(m_model, SIGNAL(columnsAboutToBeInserted(QModelIndex, int, int)),
- this, SLOT(columnsAboutToBeInserted(QModelIndex, int, int)));
- connect(m_model, SIGNAL(columnsInserted(QModelIndex, int, int)),
- this, SLOT(columnsInserted(QModelIndex, int, int)));
- connect(m_model, SIGNAL(columnsAboutToBeRemoved(QModelIndex, int, int)),
- this, SLOT(columnsAboutToBeRemoved(QModelIndex, int, int)));
- connect(m_model, SIGNAL(columnsRemoved(QModelIndex, int, int)),
- this, SLOT(columnsRemoved(QModelIndex, int, int)));
+ connect(m_model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
+ this, SLOT(rowsAboutToBeInserted(QModelIndex,int,int)));
+ connect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)),
+ this, SLOT(rowsInserted(QModelIndex,int,int)));
+ connect(m_model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
+ this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int)));
+ connect(m_model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(rowsRemoved(QModelIndex,int,int)));
+
+ connect(m_model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)),
+ this, SLOT(columnsAboutToBeInserted(QModelIndex,int,int)));
+ connect(m_model, SIGNAL(columnsInserted(QModelIndex,int,int)),
+ this, SLOT(columnsInserted(QModelIndex,int,int)));
+ connect(m_model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)),
+ this, SLOT(columnsAboutToBeRemoved(QModelIndex,int,int)));
+ connect(m_model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
+ this, SLOT(columnsRemoved(QModelIndex,int,int)));
rcFirst.fill(-1);
rcLast.fill(-1);
@@ -207,23 +207,23 @@ void tst_QStandardItemModel::init()
void tst_QStandardItemModel::cleanup()
{
- disconnect(m_model, SIGNAL(rowsAboutToBeInserted(QModelIndex, int, int)),
- this, SLOT(rowsAboutToBeInserted(QModelIndex, int, int)));
- disconnect(m_model, SIGNAL(rowsInserted(QModelIndex, int, int)),
- this, SLOT(rowsInserted(QModelIndex, int, int)));
- disconnect(m_model, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)),
- this, SLOT(rowsAboutToBeRemoved(QModelIndex, int, int)));
- disconnect(m_model, SIGNAL(rowsRemoved(QModelIndex, int, int)),
- this, SLOT(rowsRemoved(QModelIndex, int, int)));
-
- disconnect(m_model, SIGNAL(columnsAboutToBeInserted(QModelIndex, int, int)),
- this, SLOT(columnsAboutToBeInserted(QModelIndex, int, int)));
- disconnect(m_model, SIGNAL(columnsInserted(QModelIndex, int, int)),
- this, SLOT(columnsInserted(QModelIndex, int, int)));
- disconnect(m_model, SIGNAL(columnsAboutToBeRemoved(QModelIndex, int, int)),
- this, SLOT(columnsAboutToBeRemoved(QModelIndex, int, int)));
- disconnect(m_model, SIGNAL(columnsRemoved(QModelIndex, int, int)),
- this, SLOT(columnsRemoved(QModelIndex, int, int)));
+ disconnect(m_model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
+ this, SLOT(rowsAboutToBeInserted(QModelIndex,int,int)));
+ disconnect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)),
+ this, SLOT(rowsInserted(QModelIndex,int,int)));
+ disconnect(m_model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
+ this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int)));
+ disconnect(m_model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(rowsRemoved(QModelIndex,int,int)));
+
+ disconnect(m_model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)),
+ this, SLOT(columnsAboutToBeInserted(QModelIndex,int,int)));
+ disconnect(m_model, SIGNAL(columnsInserted(QModelIndex,int,int)),
+ this, SLOT(columnsInserted(QModelIndex,int,int)));
+ disconnect(m_model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)),
+ this, SLOT(columnsAboutToBeRemoved(QModelIndex,int,int)));
+ disconnect(m_model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
+ this, SLOT(columnsRemoved(QModelIndex,int,int)));
delete m_model;
m_model = 0;
}
@@ -470,9 +470,9 @@ void tst_QStandardItemModel::setHeaderData()
QCOMPARE(m_model->headerData(i, orient).toString(), QString::number(i + 1));
QSignalSpy headerDataChangedSpy(
- m_model, SIGNAL(headerDataChanged(Qt::Orientation, int, int)));
+ m_model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)));
QSignalSpy dataChangedSpy(
- m_model, SIGNAL(dataChanged(QModelIndex, QModelIndex)));
+ m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)));
// insert custom values and check
for (int i = 0; i < count; ++i) {
QString customString = QString("custom") + QString::number(i);
@@ -752,7 +752,7 @@ void tst_QStandardItemModel::clear()
QSignalSpy modelResetSpy(&model, SIGNAL(modelReset()));
QSignalSpy layoutChangedSpy(&model, SIGNAL(layoutChanged()));
- QSignalSpy rowsRemovedSpy(&model, SIGNAL(rowsRemoved(QModelIndex, int, int)));
+ QSignalSpy rowsRemovedSpy(&model, SIGNAL(rowsRemoved(QModelIndex,int,int)));
model.clear();
QCOMPARE(modelResetSpy.count(), 1);
@@ -1135,7 +1135,7 @@ void tst_QStandardItemModel::getSetItemData()
QModelIndex idx = model.index(0, 0, QModelIndex());
QSignalSpy modelDataChangedSpy(
- &model, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)));
+ &model, SIGNAL(dataChanged(QModelIndex,QModelIndex)));
QVERIFY(model.setItemData(idx, roles));
QCOMPARE(modelDataChangedSpy.count(), 1);
QVERIFY(model.setItemData(idx, roles));
@@ -1218,9 +1218,9 @@ void tst_QStandardItemModel::itemDataChanged()
QStandardItemModel model(6, 4);
QStandardItem item;
QSignalSpy dataChangedSpy(
- &model, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)));
+ &model, SIGNAL(dataChanged(QModelIndex,QModelIndex)));
QSignalSpy itemChangedSpy(
- &model, SIGNAL(itemChanged(QStandardItem *)));
+ &model, SIGNAL(itemChanged(QStandardItem*)));
model.setItem(0, &item);
QCOMPARE(dataChangedSpy.count(), 1);
diff --git a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
index f31d92751d..7ad292fd02 100644
--- a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
+++ b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
@@ -57,7 +57,9 @@ private slots:
void cleanupTestCase();
#else
void init();
+#if defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(Q_OS_QNX)
void copy_exit_paste();
+#endif
void capabilityFunctions();
void modes();
void testSignals();
@@ -191,6 +193,7 @@ void tst_QClipboard::testSignals()
QCOMPARE(dataChangedSpy.count(), 1);
}
+#if defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(Q_OS_QNX)
static bool runHelper(const QString &program, const QStringList &arguments, QByteArray *errorMessage)
{
QProcess process;
@@ -230,13 +233,11 @@ static bool runHelper(const QString &program, const QStringList &arguments, QByt
}
// Test that pasted text remains on the clipboard after a Qt application exits.
+// This test does not make sense on X11 and embedded, copied data disappears from the clipboard when the application exits
void tst_QClipboard::copy_exit_paste()
{
#ifndef QT_NO_PROCESS
-#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC) && !defined(Q_OS_QNX)
- QSKIP("This test does not make sense on X11 and embedded, copied data disappears from the clipboard when the application exits ");
// ### It's still possible to test copy/paste - just keep the apps running
-#endif
if (!PlatformClipboard::isAvailable())
QSKIP("Native clipboard not working in this setup");
const QStringList stringArgument(QStringLiteral("Test string."));
@@ -246,11 +247,12 @@ void tst_QClipboard::copy_exit_paste()
#ifdef Q_OS_MAC
// The Pasteboard needs a moment to breathe (at least on older Macs).
QTest::qWait(100);
-#endif
+#endif // Q_OS_MAC
QVERIFY2(runHelper(QStringLiteral("paster/paster"), stringArgument, &errorMessage),
errorMessage.constData());
-#endif
+#endif // QT_NO_PROCESS
}
+#endif // Q_OS_WIN || Q_OS_MAC || Q_OS_QNX
void tst_QClipboard::setMimeData()
{
diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
index ccb54b52c9..cc291f72fa 100644
--- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
+++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
@@ -107,7 +107,7 @@ void tst_QGuiApplication::focusObject()
DummyWindow window2;
window1.show();
- QSignalSpy spy(&app, SIGNAL(focusObjectChanged(QObject *)));
+ QSignalSpy spy(&app, SIGNAL(focusObjectChanged(QObject*)));
// verify active window focus propagates to qguiapplication
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index 24be319173..09180b3de9 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -1490,6 +1490,7 @@ void tst_QPainter::setWindow()
pixmap.fill(QColor(Qt::white));
QPainter painter(&pixmap);
+ painter.setRenderHint(QPainter::Qt4CompatiblePainting);
painter.setWindow(0, 0, 3, 3);
painter.drawLine(1, 1, 2, 2);
diff --git a/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp b/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp
index 2ccc6c4ad3..4172076f6a 100644
--- a/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp
+++ b/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp
@@ -470,9 +470,9 @@ void tst_QPathClipper::clipTest(int subjectIndex, int clipIndex, QPathClipper::O
p.setRenderHint(QPainter::Antialiasing);
p.scale(scale, scale);
p.translate(-bounds.topLeft());
- p.setPen(Qt::black);
+ p.setPen(QPen(Qt::black, 0));
p.drawPath(subject);
- p.setPen(Qt::red);
+ p.setPen(QPen(Qt::red, 0));
p.drawPath(clip);
p.end();
diff --git a/tests/auto/gui/painting/qpen/tst_qpen.cpp b/tests/auto/gui/painting/qpen/tst_qpen.cpp
index 35a71ba0a9..1ef7a4d0c4 100644
--- a/tests/auto/gui/painting/qpen/tst_qpen.cpp
+++ b/tests/auto/gui/painting/qpen/tst_qpen.cpp
@@ -154,9 +154,9 @@ void tst_QPen::constructor_data()
QTest::addColumn<int>("capStyle");
QTest::addColumn<int>("joinStyle");
- QTest::newRow("solid_black") << QPen() << QBrush(Qt::black) << 0. << (int)Qt::SolidLine
+ QTest::newRow("solid_black") << QPen() << QBrush(Qt::black) << 1. << (int)Qt::SolidLine
<< (int) Qt::SquareCap << (int)Qt::BevelJoin;
- QTest::newRow("solid_red") << QPen(Qt::red) << QBrush(Qt::red) << 0. << (int)Qt::SolidLine
+ QTest::newRow("solid_red") << QPen(Qt::red) << QBrush(Qt::red) << 1. << (int)Qt::SolidLine
<< (int)Qt::SquareCap << (int)Qt::BevelJoin;
QTest::newRow("full") << QPen(QBrush(QLinearGradient(0, 0, 100, 100)), 10,
Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin)
diff --git a/tests/auto/gui/text/qfont/qfont.pro b/tests/auto/gui/text/qfont/qfont.pro
index 86178f3fa6..562294dd66 100644
--- a/tests/auto/gui/text/qfont/qfont.pro
+++ b/tests/auto/gui/text/qfont/qfont.pro
@@ -2,6 +2,7 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qfont
QT += testlib
+QT += core-private gui-private
!contains(QT_CONFIG, no-widgets): QT += widgets
SOURCES += tst_qfont.cpp
diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp
index 287fd728ff..3fe23bf1ff 100644
--- a/tests/auto/gui/text/qfont/tst_qfont.cpp
+++ b/tests/auto/gui/text/qfont/tst_qfont.cpp
@@ -44,6 +44,7 @@
#include <qfont.h>
+#include <private/qfont_p.h>
#include <qfontdatabase.h>
#include <qfontinfo.h>
#include <qstringlist.h>
@@ -81,6 +82,8 @@ private slots:
void styleName();
void defaultFamily_data();
void defaultFamily();
+
+ void sharing();
};
// Testing get/set functions
@@ -685,5 +688,45 @@ void tst_QFont::defaultFamily()
QVERIFY2(isAcceptable, msgNotAcceptableFont(familyForHint, acceptableFamilies));
}
+void tst_QFont::sharing()
+{
+ QFont f;
+ f.setStyleHint(QFont::Serif);
+ f.exactMatch(); // loads engine
+ QCOMPARE(QFontPrivate::get(f)->ref.load(), 1);
+ QVERIFY(QFontPrivate::get(f)->engineData);
+ QCOMPARE(QFontPrivate::get(f)->engineData->ref.load(), 1);
+
+ QFont f2(f);
+ QVERIFY(QFontPrivate::get(f2) == QFontPrivate::get(f));
+ QCOMPARE(QFontPrivate::get(f2)->ref.load(), 2);
+ QVERIFY(QFontPrivate::get(f2)->engineData);
+ QVERIFY(QFontPrivate::get(f2)->engineData == QFontPrivate::get(f)->engineData);
+ QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 1);
+
+ f2.setKerning(!f.kerning());
+ QVERIFY(QFontPrivate::get(f2) != QFontPrivate::get(f));
+ QCOMPARE(QFontPrivate::get(f2)->ref.load(), 1);
+ QVERIFY(QFontPrivate::get(f2)->engineData);
+ QVERIFY(QFontPrivate::get(f2)->engineData == QFontPrivate::get(f)->engineData);
+ QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 2);
+
+ f2 = f;
+ QVERIFY(QFontPrivate::get(f2) == QFontPrivate::get(f));
+ QCOMPARE(QFontPrivate::get(f2)->ref.load(), 2);
+ QVERIFY(QFontPrivate::get(f2)->engineData);
+ QVERIFY(QFontPrivate::get(f2)->engineData == QFontPrivate::get(f)->engineData);
+ QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 1);
+
+ if (f.pointSize() > 0)
+ f2.setPointSize(f.pointSize() * 2 / 3);
+ else
+ f2.setPixelSize(f.pixelSize() * 2 / 3);
+ QVERIFY(QFontPrivate::get(f2) != QFontPrivate::get(f));
+ QCOMPARE(QFontPrivate::get(f2)->ref.load(), 1);
+ QVERIFY(!QFontPrivate::get(f2)->engineData);
+ QVERIFY(QFontPrivate::get(f2)->engineData != QFontPrivate::get(f)->engineData);
+}
+
QTEST_MAIN(tst_QFont)
#include "tst_qfont.moc"
diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
index 04d994db07..cf3265d446 100644
--- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
+++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
@@ -1927,8 +1927,8 @@ public:
CursorPosSignalSpy(QTextDocument *doc)
{
calls = 0;
- connect(doc, SIGNAL(cursorPositionChanged(const QTextCursor &)),
- this, SLOT(cursorPositionChanged(const QTextCursor &)));
+ connect(doc, SIGNAL(cursorPositionChanged(QTextCursor)),
+ this, SLOT(cursorPositionChanged(QTextCursor)));
}
int calls;
@@ -2054,17 +2054,17 @@ void tst_QTextDocument::markContentsDirty()
QTestDocumentLayout *lout = new QTestDocumentLayout(doc);
doc->setDocumentLayout(lout);
TestSyntaxHighlighter *highlighter = new TestSyntaxHighlighter(doc);
- connect(doc, SIGNAL(contentsChange(int, int, int)),
- highlighter, SLOT(markBlockDirty(int, int, int)));
+ connect(doc, SIGNAL(contentsChange(int,int,int)),
+ highlighter, SLOT(markBlockDirty(int,int,int)));
highlighter->ok = false;
cursor.insertText("Some dummy text blah blah");
QVERIFY(highlighter->ok);
- disconnect(doc, SIGNAL(contentsChange(int, int, int)),
- highlighter, SLOT(markBlockDirty(int, int, int)));
- connect(doc, SIGNAL(contentsChange(int, int, int)),
- highlighter, SLOT(modifyBlockAgain(int, int, int)));
+ disconnect(doc, SIGNAL(contentsChange(int,int,int)),
+ highlighter, SLOT(markBlockDirty(int,int,int)));
+ connect(doc, SIGNAL(contentsChange(int,int,int)),
+ highlighter, SLOT(modifyBlockAgain(int,int,int)));
highlighter->ok = false;
cursor.insertText("FooBar");
QVERIFY(highlighter->ok);
diff --git a/tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp b/tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp
index b3631d2016..d09a8e566b 100644
--- a/tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp
+++ b/tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp
@@ -112,12 +112,19 @@ void tst_QRegExpValidator::validate()
QFETCH( int, state );
QRegExpValidator rv( 0 );
- QSignalSpy spy(&rv, SIGNAL(regExpChanged(const QRegExp&)));
+ QSignalSpy spy(&rv, SIGNAL(regExpChanged(QRegExp)));
QSignalSpy changedSpy(&rv, SIGNAL(changed()));
rv.setRegExp( QRegExp( rx ) );
- int dummy;
- QCOMPARE( (int)rv.validate( value, dummy ), state );
+ int pos = -1;
+
+ QCOMPARE( (int)rv.validate( value, pos ), state );
+
+ if (state == QValidator::Invalid)
+ QCOMPARE(pos, value.length());
+ else
+ QCOMPARE(pos, -1); // untouched on Acceptable or Intermediate
+
QCOMPARE(spy.count(), 1);
QCOMPARE(changedSpy.count(), 1);
}