summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-12-20 23:00:16 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-12-20 23:00:16 (GMT)
commitad23f356e503536b34ea8e59aa3390459d1bbfea (patch)
treed4d2dd72b32b1b83ab9ae967af21609f11e46a46 /tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
parent8bea6ea27ff47ff2a02cb6e8ef5b16b3a7d0f0d5 (diff)
parent987a683ff51997cb23cb931af99c6554651742d7 (diff)
downloadQt-ad23f356e503536b34ea8e59aa3390459d1bbfea.zip
Qt-ad23f356e503536b34ea8e59aa3390459d1bbfea.tar.gz
Qt-ad23f356e503536b34ea8e59aa3390459d1bbfea.tar.bz2
Merge branch '4.7-upstream' into 4.7-water
Diffstat (limited to 'tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index 76e0102..7b2310a 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -354,6 +354,19 @@ void tst_qdeclarativetextinput::selection()
QVERIFY(textinputObject->selectionEnd() == 0);
QVERIFY(textinputObject->selectedText().isNull());
+ // Verify invalid positions are ignored.
+ textinputObject->setCursorPosition(-1);
+ QVERIFY(textinputObject->cursorPosition() == 0);
+ QVERIFY(textinputObject->selectionStart() == 0);
+ QVERIFY(textinputObject->selectionEnd() == 0);
+ QVERIFY(textinputObject->selectedText().isNull());
+
+ textinputObject->setCursorPosition(textinputObject->text().count()+1);
+ QVERIFY(textinputObject->cursorPosition() == 0);
+ QVERIFY(textinputObject->selectionStart() == 0);
+ QVERIFY(textinputObject->selectionEnd() == 0);
+ QVERIFY(textinputObject->selectedText().isNull());
+
//Test selection
for(int i=0; i<= testStr.size(); i++) {
textinputObject->select(0,i);