From f93bc7fabd380cf10be7f90903ace618074dc871 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 3 Dec 2012 21:43:28 +0100 Subject: remove symbian & maemo5 vestiges Change-Id: I4c02f91abde94d9ee7d154efa6eb371e1a8dfd71 Reviewed-by: Robin Burchell --- tests/auto/declarative/symbianlibs.pri | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 tests/auto/declarative/symbianlibs.pri (limited to 'tests/auto') diff --git a/tests/auto/declarative/symbianlibs.pri b/tests/auto/declarative/symbianlibs.pri deleted file mode 100644 index 4452f67f..00000000 --- a/tests/auto/declarative/symbianlibs.pri +++ /dev/null @@ -1,9 +0,0 @@ -#additional libs required for orientation sensor -symbian { - !contains(S60_VERSION, 3.1):!contains(S60_VERSION, 3.2) { - LIBS += -lsensrvclient -lsensrvutil - } - contains(QT_CONFIG, s60): { - LIBS += -lavkon -lcone - } -} -- cgit v1.2.3 From 905537e032095790b4ac1607c5ca0de2ad412476 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Tue, 4 Dec 2012 15:48:03 -0800 Subject: Remove 'com.nokia' string from autotest Change-Id: Ic318dbe7a48412e9689ca0f4506c7098d9f48b5f Reviewed-by: Robin Burchell --- .../data/importVersionMissingInstalled.errors.txt | 2 +- .../data/importVersionMissingInstalled.qml | 2 +- .../lib/com/nokia/installedtest/InstalledTest.qml | 2 - .../lib/com/nokia/installedtest/InstalledTest2.qml | 2 - .../data/lib/com/nokia/installedtest/LocalLast.qml | 2 - .../lib/com/nokia/installedtest/PrivateType.qml | 2 - .../data/lib/com/nokia/installedtest/qmldir | 4 - .../lib/com/nokia/installedtest0/InstalledTest.qml | 2 - .../com/nokia/installedtest0/InstalledTest2.qml | 2 - .../data/lib/com/nokia/installedtest0/qmldir | 2 - .../org/qtproject/installedtest/InstalledTest.qml | 2 + .../org/qtproject/installedtest/InstalledTest2.qml | 2 + .../lib/org/qtproject/installedtest/LocalLast.qml | 2 + .../org/qtproject/installedtest/PrivateType.qml | 2 + .../data/lib/org/qtproject/installedtest/qmldir | 4 + .../org/qtproject/installedtest0/InstalledTest.qml | 2 + .../qtproject/installedtest0/InstalledTest2.qml | 2 + .../data/lib/org/qtproject/installedtest0/qmldir | 2 + .../tst_qdeclarativelanguage.cpp | 128 ++++++++++----------- 19 files changed, 84 insertions(+), 84 deletions(-) delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/qmldir delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/qmldir create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/InstalledTest.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/InstalledTest2.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/LocalLast.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/PrivateType.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/qmldir create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest0/InstalledTest.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest0/InstalledTest2.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest0/qmldir (limited to 'tests/auto') diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.errors.txt index 89e58ee7..59b0b874 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.errors.txt +++ b/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.errors.txt @@ -1 +1 @@ -1:35:Library import requires a version +1:39:Library import requires a version diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.qml b/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.qml index 97ec2228..6ad2a812 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.qml @@ -1,3 +1,3 @@ -import com.nokia.installedtest as T +import org.qtproject.installedtest as T T.InstalledTest {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml deleted file mode 100644 index 9985d332..00000000 --- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml +++ /dev/null @@ -1,2 +0,0 @@ -import QtQuick 1.0 as Qt47 -Qt47.Rectangle {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml deleted file mode 100644 index f63283e7..00000000 --- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml +++ /dev/null @@ -1,2 +0,0 @@ -import QtQuick 1.0 -Text {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml deleted file mode 100644 index 7f491eb8..00000000 --- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml +++ /dev/null @@ -1,2 +0,0 @@ -import QtQuick 1.0 -Rectangle {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml deleted file mode 100644 index 03bf25bc..00000000 --- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml +++ /dev/null @@ -1,2 +0,0 @@ -import QtQuick 1.0 -Image {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/qmldir b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/qmldir deleted file mode 100644 index d15720a1..00000000 --- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/qmldir +++ /dev/null @@ -1,4 +0,0 @@ -Rectangle 1.5 InstalledTest2.qml -LocalLast 1.0 LocalLast.qml -InstalledTest 1.4 InstalledTest2.qml -InstalledTest 1.0 InstalledTest.qml diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest.qml deleted file mode 100644 index 9985d332..00000000 --- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest.qml +++ /dev/null @@ -1,2 +0,0 @@ -import QtQuick 1.0 as Qt47 -Qt47.Rectangle {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest2.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest2.qml deleted file mode 100644 index f63283e7..00000000 --- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest2.qml +++ /dev/null @@ -1,2 +0,0 @@ -import QtQuick 1.0 -Text {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/qmldir b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/qmldir deleted file mode 100644 index b3012260..00000000 --- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/qmldir +++ /dev/null @@ -1,2 +0,0 @@ -InstalledTest 1.4 InstalledTest2.qml -InstalledTestTP 0.0 InstalledTest.qml diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/InstalledTest.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/InstalledTest.qml new file mode 100644 index 00000000..9985d332 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/InstalledTest.qml @@ -0,0 +1,2 @@ +import QtQuick 1.0 as Qt47 +Qt47.Rectangle {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/InstalledTest2.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/InstalledTest2.qml new file mode 100644 index 00000000..f63283e7 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/InstalledTest2.qml @@ -0,0 +1,2 @@ +import QtQuick 1.0 +Text {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/LocalLast.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/LocalLast.qml new file mode 100644 index 00000000..7f491eb8 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/LocalLast.qml @@ -0,0 +1,2 @@ +import QtQuick 1.0 +Rectangle {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/PrivateType.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/PrivateType.qml new file mode 100644 index 00000000..03bf25bc --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/PrivateType.qml @@ -0,0 +1,2 @@ +import QtQuick 1.0 +Image {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/qmldir b/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/qmldir new file mode 100644 index 00000000..d15720a1 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest/qmldir @@ -0,0 +1,4 @@ +Rectangle 1.5 InstalledTest2.qml +LocalLast 1.0 LocalLast.qml +InstalledTest 1.4 InstalledTest2.qml +InstalledTest 1.0 InstalledTest.qml diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest0/InstalledTest.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest0/InstalledTest.qml new file mode 100644 index 00000000..9985d332 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest0/InstalledTest.qml @@ -0,0 +1,2 @@ +import QtQuick 1.0 as Qt47 +Qt47.Rectangle {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest0/InstalledTest2.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest0/InstalledTest2.qml new file mode 100644 index 00000000..f63283e7 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest0/InstalledTest2.qml @@ -0,0 +1,2 @@ +import QtQuick 1.0 +Text {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest0/qmldir b/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest0/qmldir new file mode 100644 index 00000000..b3012260 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/org/qtproject/installedtest0/qmldir @@ -0,0 +1,2 @@ +InstalledTest 1.4 InstalledTest2.qml +InstalledTestTP 0.0 InstalledTest.qml diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index e201807b..4c2946f1 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -1434,101 +1434,101 @@ void tst_qdeclarativelanguage::importsBuiltin_data() << "" << "Test is not a type"; QTest::newRow("not in version 0.0") - << "import com.nokia.Test 0.0\n" + << "import org.qtproject.Test 0.0\n" "Test {}" << "" << "Test is not a type"; QTest::newRow("version not installed") - << "import com.nokia.Test 99.0\n" + << "import org.qtproject.Test 99.0\n" "Test {}" << "" - << "module \"com.nokia.Test\" version 99.0 is not installed"; + << "module \"org.qtproject.Test\" version 99.0 is not installed"; QTest::newRow("in version 0.0") - << "import com.nokia.Test 0.0\n" + << "import org.qtproject.Test 0.0\n" "TestTP {}" << "TestType" << ""; QTest::newRow("qualified in version 0.0") - << "import com.nokia.Test 0.0 as T\n" + << "import org.qtproject.Test 0.0 as T\n" "T.TestTP {}" << "TestType" << ""; QTest::newRow("in version 1.0") - << "import com.nokia.Test 1.0\n" + << "import org.qtproject.Test 1.0\n" "Test {}" << "TestType" << ""; QTest::newRow("qualified wrong") - << "import com.nokia.Test 1.0 as T\n" // QT-610 + << "import org.qtproject.Test 1.0 as T\n" // QT-610 "Test {}" << "" << "Test is not a type"; QTest::newRow("qualified right") - << "import com.nokia.Test 1.0 as T\n" + << "import org.qtproject.Test 1.0 as T\n" "T.Test {}" << "TestType" << ""; QTest::newRow("qualified right but not in version 0.0") - << "import com.nokia.Test 0.0 as T\n" + << "import org.qtproject.Test 0.0 as T\n" "T.Test {}" << "" << "T.Test is not a type"; QTest::newRow("in version 1.1") - << "import com.nokia.Test 1.1\n" + << "import org.qtproject.Test 1.1\n" "Test {}" << "TestType" << ""; QTest::newRow("in version 1.3") - << "import com.nokia.Test 1.3\n" + << "import org.qtproject.Test 1.3\n" "Test {}" << "TestType" << ""; QTest::newRow("in version 1.5") - << "import com.nokia.Test 1.5\n" + << "import org.qtproject.Test 1.5\n" "Test {}" << "TestType" << ""; QTest::newRow("changed in version 1.8") - << "import com.nokia.Test 1.8\n" + << "import org.qtproject.Test 1.8\n" "Test {}" << "TestType2" << ""; QTest::newRow("in version 1.12") - << "import com.nokia.Test 1.12\n" + << "import org.qtproject.Test 1.12\n" "Test {}" << "TestType2" << ""; QTest::newRow("old in version 1.9") - << "import com.nokia.Test 1.9\n" + << "import org.qtproject.Test 1.9\n" "OldTest {}" << "TestType" << ""; QTest::newRow("old in version 1.11") - << "import com.nokia.Test 1.11\n" + << "import org.qtproject.Test 1.11\n" "OldTest {}" << "TestType" << ""; QTest::newRow("multiversion 1") - << "import com.nokia.Test 1.11\n" - "import com.nokia.Test 1.12\n" + << "import org.qtproject.Test 1.11\n" + "import org.qtproject.Test 1.12\n" "Test {}" << (!qmlCheckTypes()?"TestType2":"") << (!qmlCheckTypes()?"":"Test is ambiguous. Found in com/nokia/Test in version 1.12 and 1.11"); QTest::newRow("multiversion 2") - << "import com.nokia.Test 1.11\n" - "import com.nokia.Test 1.12\n" + << "import org.qtproject.Test 1.11\n" + "import org.qtproject.Test 1.12\n" "OldTest {}" << (!qmlCheckTypes()?"TestType":"") << (!qmlCheckTypes()?"":"OldTest is ambiguous. Found in com/nokia/Test in version 1.12 and 1.11"); QTest::newRow("qualified multiversion 3") - << "import com.nokia.Test 1.0 as T0\n" - "import com.nokia.Test 1.8 as T8\n" + << "import org.qtproject.Test 1.0 as T0\n" + "import org.qtproject.Test 1.8 as T8\n" "T0.Test {}" << "TestType" << ""; QTest::newRow("qualified multiversion 4") - << "import com.nokia.Test 1.0 as T0\n" - "import com.nokia.Test 1.8 as T8\n" + << "import org.qtproject.Test 1.0 as T0\n" + "import org.qtproject.Test 1.8 as T8\n" "T8.Test {}" << "TestType2" << ""; @@ -1585,7 +1585,7 @@ void tst_qdeclarativelanguage::importsLocal_data() << "Test is not a type"; QTest::newRow("library precedence over local import") << "import \"subdir\"\n" - "import com.nokia.Test 1.0\n" + "import org.qtproject.Test 1.0\n" "Test {}" << (!qmlCheckTypes()?"TestType":"") << (!qmlCheckTypes()?"":"Test is ambiguous. Found in com/nokia/Test and in subdir"); @@ -1678,47 +1678,47 @@ void tst_qdeclarativelanguage::importsInstalled_data() // import installed QTest::newRow("installed import 0") - << "import com.nokia.installedtest0 0.0\n" + << "import org.qtproject.installedtest0 0.0\n" "InstalledTestTP {}" << "QDeclarativeRectangle" << ""; QTest::newRow("installed import 0 as TP") - << "import com.nokia.installedtest0 0.0 as TP\n" + << "import org.qtproject.installedtest0 0.0 as TP\n" "TP.InstalledTestTP {}" << "QDeclarativeRectangle" << ""; QTest::newRow("installed import 1") - << "import com.nokia.installedtest 1.0\n" + << "import org.qtproject.installedtest 1.0\n" "InstalledTest {}" << "QDeclarativeRectangle" << ""; QTest::newRow("installed import 2") - << "import com.nokia.installedtest 1.3\n" + << "import org.qtproject.installedtest 1.3\n" "InstalledTest {}" << "QDeclarativeRectangle" << ""; QTest::newRow("installed import 3") - << "import com.nokia.installedtest 1.4\n" + << "import org.qtproject.installedtest 1.4\n" "InstalledTest {}" << "QDeclarativeText" << ""; QTest::newRow("installed import minor version not available") // QTBUG-11936 - << "import com.nokia.installedtest 0.1\n" + << "import org.qtproject.installedtest 0.1\n" "InstalledTest {}" << "" - << "module \"com.nokia.installedtest\" version 0.1 is not installed"; + << "module \"org.qtproject.installedtest\" version 0.1 is not installed"; QTest::newRow("installed import minor version not available") // QTBUG-9627 - << "import com.nokia.installedtest 1.10\n" + << "import org.qtproject.installedtest 1.10\n" "InstalledTest {}" << "" - << "module \"com.nokia.installedtest\" version 1.10 is not installed"; + << "module \"org.qtproject.installedtest\" version 1.10 is not installed"; QTest::newRow("installed import major version not available") // QTBUG-9627 - << "import com.nokia.installedtest 9.0\n" + << "import org.qtproject.installedtest 9.0\n" "InstalledTest {}" << "" - << "module \"com.nokia.installedtest\" version 9.0 is not installed"; + << "module \"org.qtproject.installedtest\" version 9.0 is not installed"; QTest::newRow("installed import visibility") // QT-614 - << "import com.nokia.installedtest 1.4\n" + << "import org.qtproject.installedtest 1.4\n" "PrivateType {}" << "" << "PrivateType is not a type"; @@ -1740,60 +1740,60 @@ void tst_qdeclarativelanguage::importsOrder_data() QTest::addColumn("error"); QTest::newRow("double import") << - "import com.nokia.installedtest 1.4\n" - "import com.nokia.installedtest 1.4\n" + "import org.qtproject.installedtest 1.4\n" + "import org.qtproject.installedtest 1.4\n" "InstalledTest {}" << (!qmlCheckTypes()?"QDeclarativeText":"") << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.4 and 1.4"); QTest::newRow("installed import overrides 1") << - "import com.nokia.installedtest 1.0\n" - "import com.nokia.installedtest 1.4\n" + "import org.qtproject.installedtest 1.0\n" + "import org.qtproject.installedtest 1.4\n" "InstalledTest {}" << (!qmlCheckTypes()?"QDeclarativeText":"") << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.4 and 1.0"); QTest::newRow("installed import overrides 2") << - "import com.nokia.installedtest 1.4\n" - "import com.nokia.installedtest 1.0\n" + "import org.qtproject.installedtest 1.4\n" + "import org.qtproject.installedtest 1.0\n" "InstalledTest {}" << (!qmlCheckTypes()?"QDeclarativeRectangle":"") << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.0 and 1.4"); QTest::newRow("installed import re-overrides 1") << - "import com.nokia.installedtest 1.4\n" - "import com.nokia.installedtest 1.0\n" - "import com.nokia.installedtest 1.4\n" + "import org.qtproject.installedtest 1.4\n" + "import org.qtproject.installedtest 1.0\n" + "import org.qtproject.installedtest 1.4\n" "InstalledTest {}" << (!qmlCheckTypes()?"QDeclarativeText":"") << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.4 and 1.0"); QTest::newRow("installed import re-overrides 2") << - "import com.nokia.installedtest 1.4\n" - "import com.nokia.installedtest 1.0\n" - "import com.nokia.installedtest 1.4\n" - "import com.nokia.installedtest 1.0\n" + "import org.qtproject.installedtest 1.4\n" + "import org.qtproject.installedtest 1.0\n" + "import org.qtproject.installedtest 1.4\n" + "import org.qtproject.installedtest 1.0\n" "InstalledTest {}" << (!qmlCheckTypes()?"QDeclarativeRectangle":"") << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.0 and 1.4"); QTest::newRow("installed import versus builtin 1") << - "import com.nokia.installedtest 1.5\n" + "import org.qtproject.installedtest 1.5\n" "import QtQuick 1.0\n" "Rectangle {}" << (!qmlCheckTypes()?"QDeclarativeRectangle":"") << (!qmlCheckTypes()?"":"Rectangle is ambiguous. Found in Qt and in lib/com/nokia/installedtest"); QTest::newRow("installed import versus builtin 2") << "import QtQuick 1.0\n" - "import com.nokia.installedtest 1.5\n" + "import org.qtproject.installedtest 1.5\n" "Rectangle {}" << (!qmlCheckTypes()?"QDeclarativeText":"") << (!qmlCheckTypes()?"":"Rectangle is ambiguous. Found in lib/com/nokia/installedtest and in Qt"); QTest::newRow("namespaces cannot be overridden by types 1") << "import QtQuick 1.0 as Rectangle\n" - "import com.nokia.installedtest 1.5\n" + "import org.qtproject.installedtest 1.5\n" "Rectangle {}" << "" << "Namespace Rectangle cannot be used as a type"; QTest::newRow("namespaces cannot be overridden by types 2") << "import QtQuick 1.0 as Rectangle\n" - "import com.nokia.installedtest 1.5\n" + "import org.qtproject.installedtest 1.5\n" "Rectangle.Image {}" << "QDeclarativeImage" << ""; @@ -1802,9 +1802,9 @@ void tst_qdeclarativelanguage::importsOrder_data() << "QDeclarativeText" << ""; QTest::newRow("local last 2") << - "import com.nokia.installedtest 1.0\n" + "import org.qtproject.installedtest 1.0\n" "LocalLast {}" - << (!qmlCheckTypes()?"QDeclarativeRectangle":"")// i.e. from com.nokia.installedtest, not data/LocalLast.qml + << (!qmlCheckTypes()?"QDeclarativeRectangle":"")// i.e. from org.qtproject.installedtest, not data/LocalLast.qml << (!qmlCheckTypes()?"":"LocalLast is ambiguous. Found in lib/com/nokia/installedtest and in local directory"); } @@ -1961,17 +1961,17 @@ void tst_qdeclarativelanguage::initTestCase() registerTypes(); // Registering the TestType class in other modules should have no adverse effects - qmlRegisterType("com.nokia.TestPre", 1, 0, "Test"); + qmlRegisterType("org.qtproject.TestPre", 1, 0, "Test"); - qmlRegisterType("com.nokia.Test", 0, 0, "TestTP"); - qmlRegisterType("com.nokia.Test", 1, 0, "Test"); - qmlRegisterType("com.nokia.Test", 1, 5, "Test"); - qmlRegisterType("com.nokia.Test", 1, 8, "Test"); - qmlRegisterType("com.nokia.Test", 1, 9, "OldTest"); - qmlRegisterType("com.nokia.Test", 1, 12, "Test"); + qmlRegisterType("org.qtproject.Test", 0, 0, "TestTP"); + qmlRegisterType("org.qtproject.Test", 1, 0, "Test"); + qmlRegisterType("org.qtproject.Test", 1, 5, "Test"); + qmlRegisterType("org.qtproject.Test", 1, 8, "Test"); + qmlRegisterType("org.qtproject.Test", 1, 9, "OldTest"); + qmlRegisterType("org.qtproject.Test", 1, 12, "Test"); // Registering the TestType class in other modules should have no adverse effects - qmlRegisterType("com.nokia.TestPost", 1, 0, "Test"); + qmlRegisterType("org.qtproject.TestPost", 1, 0, "Test"); // Create locale-specific file // For POSIX, this will just be data/I18nType.qml, since POSIX is 7-bit -- cgit v1.2.3 From 6b806a9c8b25a4d0b6dd0618c58f33926ea6d949 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 5 Dec 2012 11:47:09 -0800 Subject: Remove 'com/nokia' string from autotest Missed this bit in commit 905537e032095790b4ac1607c5ca0de2ad412476 Change-Id: Ic318dbe7a48412e9689ca0f4506c7098d9f48b6a Reviewed-by: Robin Burchell --- .../tst_qdeclarativelanguage.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 4c2946f1..7443e053 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -1513,13 +1513,13 @@ void tst_qdeclarativelanguage::importsBuiltin_data() "import org.qtproject.Test 1.12\n" "Test {}" << (!qmlCheckTypes()?"TestType2":"") - << (!qmlCheckTypes()?"":"Test is ambiguous. Found in com/nokia/Test in version 1.12 and 1.11"); + << (!qmlCheckTypes()?"":"Test is ambiguous. Found in org/qtproject/Test in version 1.12 and 1.11"); QTest::newRow("multiversion 2") << "import org.qtproject.Test 1.11\n" "import org.qtproject.Test 1.12\n" "OldTest {}" << (!qmlCheckTypes()?"TestType":"") - << (!qmlCheckTypes()?"":"OldTest is ambiguous. Found in com/nokia/Test in version 1.12 and 1.11"); + << (!qmlCheckTypes()?"":"OldTest is ambiguous. Found in org/qtproject/Test in version 1.12 and 1.11"); QTest::newRow("qualified multiversion 3") << "import org.qtproject.Test 1.0 as T0\n" "import org.qtproject.Test 1.8 as T8\n" @@ -1588,7 +1588,7 @@ void tst_qdeclarativelanguage::importsLocal_data() "import org.qtproject.Test 1.0\n" "Test {}" << (!qmlCheckTypes()?"TestType":"") - << (!qmlCheckTypes()?"":"Test is ambiguous. Found in com/nokia/Test and in subdir"); + << (!qmlCheckTypes()?"":"Test is ambiguous. Found in org/qtproject/Test and in subdir"); } void tst_qdeclarativelanguage::importsLocal() @@ -1744,26 +1744,26 @@ void tst_qdeclarativelanguage::importsOrder_data() "import org.qtproject.installedtest 1.4\n" "InstalledTest {}" << (!qmlCheckTypes()?"QDeclarativeText":"") - << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.4 and 1.4"); + << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/org/qtproject/installedtest in version 1.4 and 1.4"); QTest::newRow("installed import overrides 1") << "import org.qtproject.installedtest 1.0\n" "import org.qtproject.installedtest 1.4\n" "InstalledTest {}" << (!qmlCheckTypes()?"QDeclarativeText":"") - << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.4 and 1.0"); + << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/org/qtproject/installedtest in version 1.4 and 1.0"); QTest::newRow("installed import overrides 2") << "import org.qtproject.installedtest 1.4\n" "import org.qtproject.installedtest 1.0\n" "InstalledTest {}" << (!qmlCheckTypes()?"QDeclarativeRectangle":"") - << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.0 and 1.4"); + << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/org/qtproject/installedtest in version 1.0 and 1.4"); QTest::newRow("installed import re-overrides 1") << "import org.qtproject.installedtest 1.4\n" "import org.qtproject.installedtest 1.0\n" "import org.qtproject.installedtest 1.4\n" "InstalledTest {}" << (!qmlCheckTypes()?"QDeclarativeText":"") - << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.4 and 1.0"); + << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/org/qtproject/installedtest in version 1.4 and 1.0"); QTest::newRow("installed import re-overrides 2") << "import org.qtproject.installedtest 1.4\n" "import org.qtproject.installedtest 1.0\n" @@ -1771,20 +1771,20 @@ void tst_qdeclarativelanguage::importsOrder_data() "import org.qtproject.installedtest 1.0\n" "InstalledTest {}" << (!qmlCheckTypes()?"QDeclarativeRectangle":"") - << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.0 and 1.4"); + << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/org/qtproject/installedtest in version 1.0 and 1.4"); QTest::newRow("installed import versus builtin 1") << "import org.qtproject.installedtest 1.5\n" "import QtQuick 1.0\n" "Rectangle {}" << (!qmlCheckTypes()?"QDeclarativeRectangle":"") - << (!qmlCheckTypes()?"":"Rectangle is ambiguous. Found in Qt and in lib/com/nokia/installedtest"); + << (!qmlCheckTypes()?"":"Rectangle is ambiguous. Found in Qt and in lib/org/qtproject/installedtest"); QTest::newRow("installed import versus builtin 2") << "import QtQuick 1.0\n" "import org.qtproject.installedtest 1.5\n" "Rectangle {}" << (!qmlCheckTypes()?"QDeclarativeText":"") - << (!qmlCheckTypes()?"":"Rectangle is ambiguous. Found in lib/com/nokia/installedtest and in Qt"); + << (!qmlCheckTypes()?"":"Rectangle is ambiguous. Found in lib/org/qtproject/installedtest and in Qt"); QTest::newRow("namespaces cannot be overridden by types 1") << "import QtQuick 1.0 as Rectangle\n" "import org.qtproject.installedtest 1.5\n" @@ -1805,7 +1805,7 @@ void tst_qdeclarativelanguage::importsOrder_data() "import org.qtproject.installedtest 1.0\n" "LocalLast {}" << (!qmlCheckTypes()?"QDeclarativeRectangle":"")// i.e. from org.qtproject.installedtest, not data/LocalLast.qml - << (!qmlCheckTypes()?"":"LocalLast is ambiguous. Found in lib/com/nokia/installedtest and in local directory"); + << (!qmlCheckTypes()?"":"LocalLast is ambiguous. Found in lib/org/qtproject/installedtest and in local directory"); } void tst_qdeclarativelanguage::importsOrder() -- cgit v1.2.3 From 3f6834ae227b30f981d36e87ab2ad6a4f00a784b Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 5 Dec 2012 12:36:49 -0800 Subject: Stabilize tst_qdeclarativetimer Use consistent timing on the unified timer instead of qWait Manual cherry-pick of 2ebb2fce87642ef0da8629bdb27164fffbdcdcb9 Change-Id: I76c402081062f7f6849bd421e90bc96f08e8d95a Reviewed-by: Sergio Ahumada --- .../qdeclarativetimer/qdeclarativetimer.pro | 2 +- .../qdeclarativetimer/tst_qdeclarativetimer.cpp | 62 ++++++++++++++-------- 2 files changed, 40 insertions(+), 24 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro b/tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro index 4f15073a..35260dca 100644 --- a/tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro +++ b/tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro @@ -2,7 +2,7 @@ CONFIG += testcase TARGET = tst_qdeclarativetimer QT += testlib -contains(QT_CONFIG,declarative): QT += declarative declarative-private gui +contains(QT_CONFIG,declarative): QT += declarative declarative-private gui core-private macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativetimer.cpp diff --git a/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp b/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp index decd2c34..58c27f3f 100644 --- a/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp +++ b/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp @@ -45,6 +45,18 @@ #include #include #include +#include +#include + +void consistentWait(int ms) +{ + //Use animations for timing, because we enabled consistentTiming + //This function will qWait for >= ms worth of consistent timing to elapse + QPauseAnimation waitTimer(ms); + waitTimer.start(); + while (waitTimer.state() == QAbstractAnimation::Running) + QTest::qWait(20); +} class tst_qdeclarativetimer : public QObject { @@ -53,6 +65,7 @@ public: tst_qdeclarativetimer(); private slots: + void initTestCase(); void notRepeating(); void notRepeatingStart(); void repeat(); @@ -80,12 +93,15 @@ public slots: } }; -#define TIMEOUT_TIMEOUT 200 - tst_qdeclarativetimer::tst_qdeclarativetimer() { } +void tst_qdeclarativetimer::initTestCase() +{ + QUnifiedTimer::instance()->setConsistentTiming(true); +} + void tst_qdeclarativetimer::notRepeating() { QDeclarativeEngine engine; @@ -100,9 +116,10 @@ void tst_qdeclarativetimer::notRepeating() TimerHelper helper; connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout())); - QTest::qWait(TIMEOUT_TIMEOUT); + + consistentWait(200); QCOMPARE(helper.count, 1); - QTest::qWait(TIMEOUT_TIMEOUT); + consistentWait(200); QCOMPARE(helper.count, 1); QVERIFY(timer->isRunning() == false); } @@ -119,13 +136,13 @@ void tst_qdeclarativetimer::notRepeatingStart() TimerHelper helper; connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout())); - QTest::qWait(TIMEOUT_TIMEOUT); + consistentWait(200); QCOMPARE(helper.count, 0); timer->start(); - QTest::qWait(TIMEOUT_TIMEOUT); + consistentWait(200); QCOMPARE(helper.count, 1); - QTest::qWait(TIMEOUT_TIMEOUT); + consistentWait(200); QCOMPARE(helper.count, 1); QVERIFY(timer->isRunning() == false); @@ -144,18 +161,18 @@ void tst_qdeclarativetimer::repeat() connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout())); QCOMPARE(helper.count, 0); - QTest::qWait(TIMEOUT_TIMEOUT); + consistentWait(200); QVERIFY(helper.count > 0); int oldCount = helper.count; - QTest::qWait(TIMEOUT_TIMEOUT); + consistentWait(200); QVERIFY(helper.count > oldCount); QVERIFY(timer->isRunning()); oldCount = helper.count; timer->stop(); - QTest::qWait(TIMEOUT_TIMEOUT); + consistentWait(200); QVERIFY(helper.count == oldCount); QVERIFY(timer->isRunning() == false); @@ -185,12 +202,11 @@ void tst_qdeclarativetimer::triggeredOnStart() TimerHelper helper; connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout())); - QTest::qWait(1); + consistentWait(1); QCOMPARE(helper.count, 1); - - QTest::qWait(TIMEOUT_TIMEOUT); + consistentWait(200); QCOMPARE(helper.count, 2); - QTest::qWait(TIMEOUT_TIMEOUT); + consistentWait(200); QCOMPARE(helper.count, 2); QVERIFY(timer->isRunning() == false); @@ -219,13 +235,13 @@ void tst_qdeclarativetimer::triggeredOnStartRepeat() TimerHelper helper; connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout())); - QTest::qWait(1); + consistentWait(1); QCOMPARE(helper.count, 1); - QTest::qWait(TIMEOUT_TIMEOUT); + consistentWait(200); QVERIFY(helper.count > 1); int oldCount = helper.count; - QTest::qWait(TIMEOUT_TIMEOUT); + consistentWait(200); QVERIFY(helper.count > oldCount); QVERIFY(timer->isRunning()); @@ -245,7 +261,7 @@ void tst_qdeclarativetimer::noTriggerIfNotRunning() ), QUrl::fromLocalFile("")); QObject *item = component.create(); QVERIFY(item != 0); - QTest::qWait(TIMEOUT_TIMEOUT); + consistentWait(200); QCOMPARE(item->property("ok").toBool(), true); delete item; @@ -263,12 +279,12 @@ void tst_qdeclarativetimer::changeDuration() connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout())); QCOMPARE(helper.count, 0); - QTest::qWait(500); + consistentWait(500); QCOMPARE(helper.count, 2); timer->setInterval(500); - QTest::qWait(600); + consistentWait(600); QCOMPARE(helper.count, 3); QVERIFY(timer->isRunning()); @@ -299,14 +315,14 @@ void tst_qdeclarativetimer::restart() connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout())); QCOMPARE(helper.count, 0); - QTest::qWait(600); + consistentWait(600); QCOMPARE(helper.count, 1); - QTest::qWait(300); + consistentWait(300); timer->restart(); - QTest::qWait(700); + consistentWait(700); QCOMPARE(helper.count, 2); QVERIFY(timer->isRunning()); -- cgit v1.2.3 From 27c89b420211cbacd06681181e5ae41ca96d73c5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 11 Dec 2012 15:55:52 +0100 Subject: Fix typo in metatype registration. Change-Id: If0fd01464160259d634770908d5c284db2bbe582 Reviewed-by: Lars Knoll --- tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp b/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp index 72f1afcb..9231c17b 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp @@ -127,7 +127,7 @@ void registerTypes() qmlRegisterType("Qt.test",1,0,"QPlainTextEdit"); qRegisterMetaType("MyQmlObject::MyType"); - qRegisterMetaType("MyEnum2"); + qRegisterMetaType("MyEnum2"); qRegisterMetaType("Qt::MouseButtons"); } -- cgit v1.2.3 From 60c101b9907479e8bb6aa9770114572a72434dc6 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 3 Dec 2012 21:43:42 +0100 Subject: make use of qt_headersclean.prf Change-Id: I55d94c152217e419a2c8f04d174996a71eb933a5 Reviewed-by: Joerg Bornemann --- tests/auto/headersclean/headersclean.pro | 8 +--- tests/auto/headersclean/qt_headersclean_headers.h | 47 ----------------------- 2 files changed, 2 insertions(+), 53 deletions(-) delete mode 100644 tests/auto/headersclean/qt_headersclean_headers.h (limited to 'tests/auto') diff --git a/tests/auto/headersclean/headersclean.pro b/tests/auto/headersclean/headersclean.pro index 201fc143..d9bf7d84 100644 --- a/tests/auto/headersclean/headersclean.pro +++ b/tests/auto/headersclean/headersclean.pro @@ -1,6 +1,2 @@ -QT = core testlib gui declarative -HEADERSCLEAN_PRI = $${QT.core.sources}/../../tests/auto/other/headersclean/headersclean.pri -isEmpty(QT.core.sources)|!include($$HEADERSCLEAN_PRI) { - warning("headersclean.pri from QtCore sources not available. test disabled") - TEMPLATE=subdirs -} +QT = declarative +load(qt_headersclean) diff --git a/tests/auto/headersclean/qt_headersclean_headers.h b/tests/auto/headersclean/qt_headersclean_headers.h deleted file mode 100644 index 2133ce46..00000000 --- a/tests/auto/headersclean/qt_headersclean_headers.h +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QT_HEADERSCLEAN_HEADERS -#define QT_HEADERSCLEAN_HEADERS - -#include - -#endif -- cgit v1.2.3 From 04cb8ef1ee919f071540ccb5cae10bb47f37fb3e Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 5 Dec 2012 11:42:20 +0100 Subject: centralize and fixup example sources install targets follow respective change in qtbase Change-Id: I15346e16cd1d6f30cf32a77284b5f19b1dd2a7a9 Reviewed-by: Oswald Buddenhagen Reviewed-by: hjk --- tests/auto/declarative/examples/tst_examples.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/declarative/examples/tst_examples.cpp b/tests/auto/declarative/examples/tst_examples.cpp index 1c57b04f..1d7aa0f9 100644 --- a/tests/auto/declarative/examples/tst_examples.cpp +++ b/tests/auto/declarative/examples/tst_examples.cpp @@ -68,7 +68,8 @@ tst_examples::tst_examples() { // Add directories you want excluded here excludedDirs << "doc/src/snippets/declarative/visualdatamodel_rootindex" - << "doc/src/snippets/declarative/qtbinding"; + << "doc/src/snippets/declarative/qtbinding" + << "examples/declarative/tutorials"; //Excluded when tutorials were moved into examples (not checked before) // Known to violate naming conventions, QTQAINFRA-428 excludedDirs << "demos/mobile/qtbubblelevel/qml" << "demos/mobile/quickhit"; -- cgit v1.2.3 From 6d7d47551de18509a382185e1216632f3d862f01 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Wed, 5 Dec 2012 02:12:30 +0100 Subject: Process imports in the order they appear in the code. By placing imports into a hash keyed by the qualifier, imports were not processed in the order they appeared in the source. This is perhaps not a major problem, but it is nice to have predictability. This becomes more important in Qt 5, when QHash is randomly seeded at application startup, as alterations to order could have strange side effects on code. Reported-by: Maciej Blomberg Change-Id: Ibd34fab1eed4bc727b498ba4684c62d801ae713b Reviewed-by: Matthew Vogt Reviewed-by: Lars Knoll --- .../declarative/qdeclarativeimportorder/data/a.js | 1 + .../declarative/qdeclarativeimportorder/data/b.js | 1 + .../declarative/qdeclarativeimportorder/data/c.js | 1 + .../declarative/qdeclarativeimportorder/data/d.js | 1 + .../declarative/qdeclarativeimportorder/data/e.js | 1 + .../declarative/qdeclarativeimportorder/data/f.js | 1 + .../declarative/qdeclarativeimportorder/data/g.js | 1 + .../declarative/qdeclarativeimportorder/data/h.js | 1 + .../declarative/qdeclarativeimportorder/data/i.js | 1 + .../qdeclarativeimportorder/data/importOrderJs.qml | 30 +++++++ .../declarative/qdeclarativeimportorder/data/j.js | 1 + .../declarative/qdeclarativeimportorder/data/k.js | 1 + .../declarative/qdeclarativeimportorder/data/l.js | 1 + .../declarative/qdeclarativeimportorder/data/m.js | 1 + .../declarative/qdeclarativeimportorder/data/n.js | 1 + .../declarative/qdeclarativeimportorder/data/o.js | 1 + .../declarative/qdeclarativeimportorder/data/p.js | 1 + .../declarative/qdeclarativeimportorder/data/q.js | 1 + .../declarative/qdeclarativeimportorder/data/r.js | 1 + .../declarative/qdeclarativeimportorder/data/s.js | 1 + .../declarative/qdeclarativeimportorder/data/t.js | 1 + .../declarative/qdeclarativeimportorder/data/u.js | 1 + .../declarative/qdeclarativeimportorder/data/v.js | 1 + .../declarative/qdeclarativeimportorder/data/w.js | 1 + .../declarative/qdeclarativeimportorder/data/x.js | 1 + .../declarative/qdeclarativeimportorder/data/y.js | 1 + .../declarative/qdeclarativeimportorder/data/z.js | 1 + .../qdeclarativeimportorder.pro | 14 +++ .../tst_qdeclarativeimportorder.cpp | 99 ++++++++++++++++++++++ 29 files changed, 169 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/a.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/b.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/c.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/d.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/e.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/f.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/g.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/h.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/i.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/importOrderJs.qml create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/j.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/k.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/l.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/m.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/n.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/o.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/p.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/q.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/r.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/s.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/t.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/u.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/v.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/w.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/x.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/y.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/data/z.js create mode 100644 tests/auto/declarative/qdeclarativeimportorder/qdeclarativeimportorder.pro create mode 100644 tests/auto/declarative/qdeclarativeimportorder/tst_qdeclarativeimportorder.cpp (limited to 'tests/auto') diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/a.js b/tests/auto/declarative/qdeclarativeimportorder/data/a.js new file mode 100644 index 00000000..49c40f77 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/a.js @@ -0,0 +1 @@ +console.log("a.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/b.js b/tests/auto/declarative/qdeclarativeimportorder/data/b.js new file mode 100644 index 00000000..786ef862 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/b.js @@ -0,0 +1 @@ +console.log("b.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/c.js b/tests/auto/declarative/qdeclarativeimportorder/data/c.js new file mode 100644 index 00000000..3e1d32f0 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/c.js @@ -0,0 +1 @@ +console.log("c.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/d.js b/tests/auto/declarative/qdeclarativeimportorder/data/d.js new file mode 100644 index 00000000..4c339077 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/d.js @@ -0,0 +1 @@ +console.log("d.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/e.js b/tests/auto/declarative/qdeclarativeimportorder/data/e.js new file mode 100644 index 00000000..ac758f93 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/e.js @@ -0,0 +1 @@ +console.log("e.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/f.js b/tests/auto/declarative/qdeclarativeimportorder/data/f.js new file mode 100644 index 00000000..04b0cf3a --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/f.js @@ -0,0 +1 @@ +console.log("f.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/g.js b/tests/auto/declarative/qdeclarativeimportorder/data/g.js new file mode 100644 index 00000000..e6747104 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/g.js @@ -0,0 +1 @@ +console.log("g.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/h.js b/tests/auto/declarative/qdeclarativeimportorder/data/h.js new file mode 100644 index 00000000..8f81e240 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/h.js @@ -0,0 +1 @@ +console.log("h.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/i.js b/tests/auto/declarative/qdeclarativeimportorder/data/i.js new file mode 100644 index 00000000..a074b78c --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/i.js @@ -0,0 +1 @@ +console.log("i.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/importOrderJs.qml b/tests/auto/declarative/qdeclarativeimportorder/data/importOrderJs.qml new file mode 100644 index 00000000..6cad175e --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/importOrderJs.qml @@ -0,0 +1,30 @@ +import QtQuick 1.1 +import "a.js" as A +import "b.js" as B +import "c.js" as C +import "d.js" as D +import "e.js" as E +import "f.js" as F +import "g.js" as G +import "h.js" as H +import "i.js" as I +import "j.js" as J +import "k.js" as K +import "l.js" as L +import "m.js" as M +import "n.js" as N +import "o.js" as O +import "p.js" as P +import "q.js" as Q +import "r.js" as R +import "s.js" as S +import "t.js" as T +import "u.js" as U +import "v.js" as V +import "w.js" as W +import "x.js" as X +import "y.js" as Y +import "z.js" as Z + +Item { +} diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/j.js b/tests/auto/declarative/qdeclarativeimportorder/data/j.js new file mode 100644 index 00000000..1b336d06 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/j.js @@ -0,0 +1 @@ +console.log("j.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/k.js b/tests/auto/declarative/qdeclarativeimportorder/data/k.js new file mode 100644 index 00000000..b205c1c4 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/k.js @@ -0,0 +1 @@ +console.log("k.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/l.js b/tests/auto/declarative/qdeclarativeimportorder/data/l.js new file mode 100644 index 00000000..36331a88 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/l.js @@ -0,0 +1 @@ +console.log("l.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/m.js b/tests/auto/declarative/qdeclarativeimportorder/data/m.js new file mode 100644 index 00000000..f8ec9a06 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/m.js @@ -0,0 +1 @@ +console.log("m.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/n.js b/tests/auto/declarative/qdeclarativeimportorder/data/n.js new file mode 100644 index 00000000..59ea354c --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/n.js @@ -0,0 +1 @@ +console.log("n.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/o.js b/tests/auto/declarative/qdeclarativeimportorder/data/o.js new file mode 100644 index 00000000..1bdad649 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/o.js @@ -0,0 +1 @@ +console.log("o.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/p.js b/tests/auto/declarative/qdeclarativeimportorder/data/p.js new file mode 100644 index 00000000..ba37e9cc --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/p.js @@ -0,0 +1 @@ +console.log("p.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/q.js b/tests/auto/declarative/qdeclarativeimportorder/data/q.js new file mode 100644 index 00000000..6f226207 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/q.js @@ -0,0 +1 @@ +console.log("q.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/r.js b/tests/auto/declarative/qdeclarativeimportorder/data/r.js new file mode 100644 index 00000000..9f9b25a0 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/r.js @@ -0,0 +1 @@ +console.log("r.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/s.js b/tests/auto/declarative/qdeclarativeimportorder/data/s.js new file mode 100644 index 00000000..f81ca099 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/s.js @@ -0,0 +1 @@ +console.log("s.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/t.js b/tests/auto/declarative/qdeclarativeimportorder/data/t.js new file mode 100644 index 00000000..3f150a77 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/t.js @@ -0,0 +1 @@ +console.log("t.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/u.js b/tests/auto/declarative/qdeclarativeimportorder/data/u.js new file mode 100644 index 00000000..426bdd09 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/u.js @@ -0,0 +1 @@ +console.log("u.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/v.js b/tests/auto/declarative/qdeclarativeimportorder/data/v.js new file mode 100644 index 00000000..66d23f52 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/v.js @@ -0,0 +1 @@ +console.log("v.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/w.js b/tests/auto/declarative/qdeclarativeimportorder/data/w.js new file mode 100644 index 00000000..ecefb1d0 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/w.js @@ -0,0 +1 @@ +console.log("w.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/x.js b/tests/auto/declarative/qdeclarativeimportorder/data/x.js new file mode 100644 index 00000000..64112bb4 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/x.js @@ -0,0 +1 @@ +console.log("x.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/y.js b/tests/auto/declarative/qdeclarativeimportorder/data/y.js new file mode 100644 index 00000000..9ed70f26 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/y.js @@ -0,0 +1 @@ +console.log("y.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/data/z.js b/tests/auto/declarative/qdeclarativeimportorder/data/z.js new file mode 100644 index 00000000..0e6fc83e --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/data/z.js @@ -0,0 +1 @@ +console.log("z.js") diff --git a/tests/auto/declarative/qdeclarativeimportorder/qdeclarativeimportorder.pro b/tests/auto/declarative/qdeclarativeimportorder/qdeclarativeimportorder.pro new file mode 100644 index 00000000..725b6d6a --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/qdeclarativeimportorder.pro @@ -0,0 +1,14 @@ +CONFIG += testcase +TARGET = tst_qdeclarativeimportorder + +QT += testlib +contains(QT_CONFIG,declarative): QT += declarative widgets +macx:CONFIG -= app_bundle + +SOURCES += tst_qdeclarativeimportorder.cpp + +include(../shared/qdeclarativedatatest.pri) + +CONFIG += parallel_test + +DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/declarative/qdeclarativeimportorder/tst_qdeclarativeimportorder.cpp b/tests/auto/declarative/qdeclarativeimportorder/tst_qdeclarativeimportorder.cpp new file mode 100644 index 00000000..ecf35100 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimportorder/tst_qdeclarativeimportorder.cpp @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Jolla Mobile +** Contact: http://www.qt-project.org/legal +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include + +#include + + +class tst_qdeclarativeimportorder : public QDeclarativeDataTest +{ + Q_OBJECT +public: + tst_qdeclarativeimportorder() + { + } + +private slots: + void qmlObject(); + +private: + QDeclarativeEngine engine; +}; + +Q_GLOBAL_STATIC(QStringList, importMessages); + +static void orderedImportMsgHandler(QtMsgType type, const QMessageLogContext &, const QString &message) +{ + if (type == QtDebugMsg) + importMessages()->append(message); + else + fprintf(stderr, "possibly unexpected message of type %d: %s", type, qPrintable(message)); +} + +void tst_qdeclarativeimportorder::qmlObject() +{ + QDeclarativeComponent component(&engine, testFileUrl("importOrderJs.qml")); + + QtMessageHandler old = qInstallMessageHandler(orderedImportMsgHandler); + QObject *object = component.create(); + qInstallMessageHandler(old); // do this before the QVERIFY so output goes out ok if it errors + QVERIFY(object != 0); + QCOMPARE(*importMessages(), QStringList() << "a.js" << "b.js" << "c.js" + << "d.js" << "e.js" << "f.js" + << "g.js" << "h.js" << "i.js" + << "j.js" << "k.js" << "l.js" + << "m.js" << "n.js" << "o.js" + << "p.js" << "q.js" << "r.js" + << "s.js" << "t.js" << "u.js" + << "v.js" << "w.js" << "x.js" + << "y.js" << "z.js"); + // now I know my ABCs, + // next time won't you sing with me? +} + +QTEST_MAIN(tst_qdeclarativeimportorder) + +#include "tst_qdeclarativeimportorder.moc" -- cgit v1.2.3 From 5d439d751267c64408bd27ab0e6548822146a35c Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 11 Dec 2012 17:25:44 +1000 Subject: Backport PathView currentIndex fixes from Qt 5 Backport 447e5acb880ebda498891623dc4009984cb73bc6 and 0fc361f96b06ba318e70610e46beb421753cae9d which fix bugs related to currentIndex. The first commit ensures currentIndex=0 when all items are removed; the second ensures that the initial currentIndex value is respected and also resets the view correctly if the model changes. Change-Id: I73266a211001a54163be8415d449802ff077a72e Reviewed-by: Martin Jones --- .../data/initialCurrentIndex.qml | 60 ++++ .../tst_qdeclarativepathview.cpp | 367 +++++++++++++++++++++ 2 files changed, 427 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativepathview/data/initialCurrentIndex.qml (limited to 'tests/auto') diff --git a/tests/auto/declarative/qdeclarativepathview/data/initialCurrentIndex.qml b/tests/auto/declarative/qdeclarativepathview/data/initialCurrentIndex.qml new file mode 100644 index 00000000..e6361522 --- /dev/null +++ b/tests/auto/declarative/qdeclarativepathview/data/initialCurrentIndex.qml @@ -0,0 +1,60 @@ +import QtQuick 1.1 + +PathView { + id: photoPathView + y: 100; width: 800; height: 330; pathItemCount: 4 + currentIndex: 3 + dragMargin: 24 + preferredHighlightBegin: 0.50 + preferredHighlightEnd: 0.50 + + path: Path { + startX: -50; startY: 40; + + PathAttribute { name: "scale"; value: 0.5 } + PathAttribute { name: "angle"; value: -45 } + + PathCubic { + x: 400; y: 220 + control1X: 140; control1Y: 40 + control2X: 210; control2Y: 220 + } + + PathAttribute { name: "scale"; value: 1.2 } + PathAttribute { name: "angle"; value: 0 } + + PathCubic { + x: 850; y: 40 + control2X: 660; control2Y: 40 + control1X: 590; control1Y: 220 + } + + PathAttribute { name: "scale"; value: 0.5 } + PathAttribute { name: "angle"; value: 45 } + } + + model: ListModel { + id: rssModel + ListElement { lColor: "red" } + ListElement { lColor: "green" } + ListElement { lColor: "yellow" } + ListElement { lColor: "blue" } + ListElement { lColor: "purple" } + ListElement { lColor: "gray" } + ListElement { lColor: "brown" } + ListElement { lColor: "thistle" } + } + + delegate: Component { + id: photoDelegate + Rectangle { + id: wrapper + width: 85; height: 85; color: lColor + + transform: Rotation { + id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2 + axis.y: 1; axis.z: 0 + } + } + } +} diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp index 247c19e3..0d7dbe6f 100644 --- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp +++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp @@ -56,6 +56,33 @@ #include #include +template +static void qdeclarativepathview_move(int from, int to, int n, T *items) +{ + if (from > to) { + // Only move forwards - flip if backwards moving + int tfrom = from; + int tto = to; + from = tto; + to = tto+n; + n = tfrom-tto; + } + + T replaced; + int i=0; + typename T::ConstIterator it=items->begin(); it += from+n; + for (; ibegin(); it += from; + for (; ibegin(); t += from; + for (; f != replaced.end(); ++f, ++t) + *t = *f; +} + static void initStandardTreeModel(QStandardItemModel *model) { QStandardItem *item; @@ -87,6 +114,13 @@ private slots: void dataModel(); void pathview2(); void pathview3(); + void initialCurrentIndex(); + void insertModel_data(); + void insertModel(); + void removeModel_data(); + void removeModel(); + void moveModel_data(); + void moveModel(); void path(); void pathMoved(); void setCurrentIndex(); @@ -183,18 +217,41 @@ public: endInsertRows(); } + void insertItems(int index, const QList > &items) + { + emit beginInsertRows(QModelIndex(), index, index+items.count()-1); + for (int i=0; i(items[i].first, items[i].second)); + emit endInsertRows(); + } + void removeItem(int index) { beginRemoveRows(QModelIndex(), index, index); list.removeAt(index); endRemoveRows(); } + void removeItems(int index, int count) + { + emit beginRemoveRows(QModelIndex(), index, index+count-1); + while (count--) + list.removeAt(index); + emit endRemoveRows(); + } + void moveItem(int from, int to) { beginMoveRows(QModelIndex(), from, from, QModelIndex(), to); list.move(from, to); endMoveRows(); } + void moveItems(int from, int to, int count) + { + emit beginMoveRows(QModelIndex(), from, from+count-1, QModelIndex(), to > from ? to+count : to); + qdeclarativepathview_move(from, to, count, &list); + emit endMoveRows(); + } + void modifyItem(int idx, const QString &name, const QString &number) { list[idx] = QPair(name, number); emit dataChanged(index(idx,0), index(idx,0)); @@ -308,6 +365,116 @@ void tst_QDeclarativePathView::pathview3() QCOMPARE(obj->pathItemCount(), 4); } +void tst_QDeclarativePathView::initialCurrentIndex() +{ + QDeclarativeEngine engine; + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/initialCurrentIndex.qml")); + QDeclarativePathView *obj = qobject_cast(c.create()); + + QVERIFY(obj != 0); + QVERIFY(obj->path() != 0); + QVERIFY(obj->delegate() != 0); + QVERIFY(obj->model() != QVariant()); + QCOMPARE(obj->currentIndex(), 3); + QCOMPARE(obj->offset(), 5.0); + QCOMPARE(obj->preferredHighlightBegin(), 0.5); + QCOMPARE(obj->dragMargin(), 24.); + QCOMPARE(obj->count(), 8); + QCOMPARE(obj->pathItemCount(), 4); + + delete obj; +} + +void tst_QDeclarativePathView::insertModel_data() +{ + QTest::addColumn("mode"); + QTest::addColumn("idx"); + QTest::addColumn("count"); + QTest::addColumn("offset"); + QTest::addColumn("currentIndex"); + + // We have 8 items, with currentIndex == 4 + QTest::newRow("insert after current") + << int(QDeclarativePathView::StrictlyEnforceRange) << 6 << 1 << 5. << 4; + QTest::newRow("insert before current") + << int(QDeclarativePathView::StrictlyEnforceRange) << 2 << 1 << 4. << 5; + QTest::newRow("insert multiple after current") + << int(QDeclarativePathView::StrictlyEnforceRange) << 5 << 2 << 6. << 4; + QTest::newRow("insert multiple before current") + << int(QDeclarativePathView::StrictlyEnforceRange) << 1 << 2 << 4. << 6; + QTest::newRow("insert at end") + << int(QDeclarativePathView::StrictlyEnforceRange) << 8 << 1 << 5. << 4; + QTest::newRow("insert at beginning") + << int(QDeclarativePathView::StrictlyEnforceRange) << 0 << 1 << 4. << 5; + QTest::newRow("insert at current") + << int(QDeclarativePathView::StrictlyEnforceRange) << 4 << 1 << 4. << 5; + + QTest::newRow("no range - insert after current") + << int(QDeclarativePathView::NoHighlightRange) << 6 << 1 << 5. << 4; + QTest::newRow("no range - insert before current") + << int(QDeclarativePathView::NoHighlightRange) << 2 << 1 << 4. << 5; + QTest::newRow("no range - insert multiple after current") + << int(QDeclarativePathView::NoHighlightRange) << 5 << 2 << 6. << 4; + QTest::newRow("no range - insert multiple before current") + << int(QDeclarativePathView::NoHighlightRange) << 1 << 2 << 4. << 6; + QTest::newRow("no range - insert at end") + << int(QDeclarativePathView::NoHighlightRange) << 8 << 1 << 5. << 4; + QTest::newRow("no range - insert at beginning") + << int(QDeclarativePathView::NoHighlightRange) << 0 << 1 << 4. << 5; + QTest::newRow("no range - insert at current") + << int(QDeclarativePathView::NoHighlightRange) << 4 << 1 << 4. << 5; +} + +void tst_QDeclarativePathView::insertModel() +{ + QFETCH(int, mode); + QFETCH(int, idx); + QFETCH(int, count); + QFETCH(qreal, offset); + QFETCH(int, currentIndex); + + QDeclarativeView *window = createView(); + window->show(); + + TestModel model; + model.addItem("Ben", "12345"); + model.addItem("Bohn", "2345"); + model.addItem("Bob", "54321"); + model.addItem("Bill", "4321"); + model.addItem("Jinny", "679"); + model.addItem("Milly", "73378"); + model.addItem("Jimmy", "3535"); + model.addItem("Barb", "9039"); + + QDeclarativeContext *ctxt = window->rootContext(); + ctxt->setContextProperty("testModel", &model); + + window->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview0.qml")); + qApp->processEvents(); + + QDeclarativePathView *pathview = findItem(window->rootObject(), "view"); + QVERIFY(pathview != 0); + + pathview->setHighlightRangeMode((QDeclarativePathView::HighlightRangeMode)mode); + + pathview->setCurrentIndex(4); + if (mode == QDeclarativePathView::StrictlyEnforceRange) + QTRY_COMPARE(pathview->offset(), 4.0); + else + pathview->setOffset(4); + + QList > items; + for (int i = 0; i < count; ++i) + items.append(qMakePair(QString("New"), QString::number(i))); + + model.insertItems(idx, items); + QTRY_COMPARE(pathview->offset(), offset); + + QCOMPARE(pathview->currentIndex(), currentIndex); + + delete window; +} + void tst_QDeclarativePathView::path() { QDeclarativeEngine engine; @@ -353,6 +520,192 @@ void tst_QDeclarativePathView::path() QCOMPARE(cubic->control2Y(), 90.); } +void tst_QDeclarativePathView::removeModel_data() +{ + QTest::addColumn("mode"); + QTest::addColumn("idx"); + QTest::addColumn("count"); + QTest::addColumn("offset"); + QTest::addColumn("currentIndex"); + + // We have 8 items, with currentIndex == 4 + QTest::newRow("remove after current") + << int(QDeclarativePathView::StrictlyEnforceRange) << 6 << 1 << 3. << 4; + QTest::newRow("remove before current") + << int(QDeclarativePathView::StrictlyEnforceRange) << 2 << 1 << 4. << 3; + QTest::newRow("remove multiple after current") + << int(QDeclarativePathView::StrictlyEnforceRange) << 5 << 2 << 2. << 4; + QTest::newRow("remove multiple before current") + << int(QDeclarativePathView::StrictlyEnforceRange) << 1 << 2 << 4. << 2; + QTest::newRow("remove last") + << int(QDeclarativePathView::StrictlyEnforceRange) << 7 << 1 << 3. << 4; + QTest::newRow("remove first") + << int(QDeclarativePathView::StrictlyEnforceRange) << 0 << 1 << 4. << 3; + QTest::newRow("remove current") + << int(QDeclarativePathView::StrictlyEnforceRange) << 4 << 1 << 3. << 4; + QTest::newRow("remove all") + << int(QDeclarativePathView::StrictlyEnforceRange) << 0 << 8 << 0. << 0; + + QTest::newRow("no range - remove after current") + << int(QDeclarativePathView::NoHighlightRange) << 6 << 1 << 3. << 4; + QTest::newRow("no range - remove before current") + << int(QDeclarativePathView::NoHighlightRange) << 2 << 1 << 4. << 3; + QTest::newRow("no range - remove multiple after current") + << int(QDeclarativePathView::NoHighlightRange) << 5 << 2 << 2. << 4; + QTest::newRow("no range - remove multiple before current") + << int(QDeclarativePathView::NoHighlightRange) << 1 << 2 << 4. << 2; + QTest::newRow("no range - remove last") + << int(QDeclarativePathView::NoHighlightRange) << 7 << 1 << 3. << 4; + QTest::newRow("no range - remove first") + << int(QDeclarativePathView::NoHighlightRange) << 0 << 1 << 4. << 3; + QTest::newRow("no range - remove current offset") + << int(QDeclarativePathView::NoHighlightRange) << 4 << 1 << 4. << 4; + QTest::newRow("no range - remove all") + << int(QDeclarativePathView::NoHighlightRange) << 0 << 8 << 0. << 0; +} + +void tst_QDeclarativePathView::removeModel() +{ + QFETCH(int, mode); + QFETCH(int, idx); + QFETCH(int, count); + QFETCH(qreal, offset); + QFETCH(int, currentIndex); + + QDeclarativeView *window = createView(); + window->show(); + + TestModel model; + model.addItem("Ben", "12345"); + model.addItem("Bohn", "2345"); + model.addItem("Bob", "54321"); + model.addItem("Bill", "4321"); + model.addItem("Jinny", "679"); + model.addItem("Milly", "73378"); + model.addItem("Jimmy", "3535"); + model.addItem("Barb", "9039"); + + QDeclarativeContext *ctxt = window->rootContext(); + ctxt->setContextProperty("testModel", &model); + + window->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview0.qml")); + qApp->processEvents(); + + QDeclarativePathView *pathview = findItem(window->rootObject(), "view"); + QVERIFY(pathview != 0); + + pathview->setHighlightRangeMode((QDeclarativePathView::HighlightRangeMode)mode); + + pathview->setCurrentIndex(4); + if (mode == QDeclarativePathView::StrictlyEnforceRange) + QTRY_COMPARE(pathview->offset(), 4.0); + else + pathview->setOffset(4); + + model.removeItems(idx, count); + QTRY_COMPARE(pathview->offset(), offset); + + QCOMPARE(pathview->currentIndex(), currentIndex); + + delete window; +} +void tst_QDeclarativePathView::moveModel_data() +{ + QTest::addColumn("mode"); + QTest::addColumn("from"); + QTest::addColumn("to"); + QTest::addColumn("count"); + QTest::addColumn("offset"); + QTest::addColumn("currentIndex"); + + // We have 8 items, with currentIndex == 4 + QTest::newRow("move after current") + << int(QDeclarativePathView::StrictlyEnforceRange) << 5 << 6 << 1 << 4. << 4; + QTest::newRow("move before current") + << int(QDeclarativePathView::StrictlyEnforceRange) << 2 << 3 << 1 << 4. << 4; + QTest::newRow("move before current to after") + << int(QDeclarativePathView::StrictlyEnforceRange) << 2 << 6 << 1 << 5. << 3; + QTest::newRow("move multiple after current") + << int(QDeclarativePathView::StrictlyEnforceRange) << 5 << 6 << 2 << 4. << 4; + QTest::newRow("move multiple before current") + << int(QDeclarativePathView::StrictlyEnforceRange) << 0 << 1 << 2 << 4. << 4; + QTest::newRow("move before current to end") + << int(QDeclarativePathView::StrictlyEnforceRange) << 2 << 7 << 1 << 5. << 3; + QTest::newRow("move last to beginning") + << int(QDeclarativePathView::StrictlyEnforceRange) << 7 << 0 << 1 << 3. << 5; + QTest::newRow("move current") + << int(QDeclarativePathView::StrictlyEnforceRange) << 4 << 6 << 1 << 2. << 6; + + QTest::newRow("no range - move after current") + << int(QDeclarativePathView::NoHighlightRange) << 5 << 6 << 1 << 4. << 4; + QTest::newRow("no range - move before current") + << int(QDeclarativePathView::NoHighlightRange) << 2 << 3 << 1 << 4. << 4; + QTest::newRow("no range - move before current to after") + << int(QDeclarativePathView::NoHighlightRange) << 2 << 6 << 1 << 5. << 3; + QTest::newRow("no range - move multiple after current") + << int(QDeclarativePathView::NoHighlightRange) << 5 << 6 << 2 << 4. << 4; + QTest::newRow("no range - move multiple before current") + << int(QDeclarativePathView::NoHighlightRange) << 0 << 1 << 2 << 4. << 4; + QTest::newRow("no range - move before current to end") + << int(QDeclarativePathView::NoHighlightRange) << 2 << 7 << 1 << 5. << 3; + QTest::newRow("no range - move last to beginning") + << int(QDeclarativePathView::NoHighlightRange) << 7 << 0 << 1 << 3. << 5; + QTest::newRow("no range - move current") + << int(QDeclarativePathView::NoHighlightRange) << 4 << 6 << 1 << 4. << 6; + QTest::newRow("no range - move multiple incl. current") + << int(QDeclarativePathView::NoHighlightRange) << 0 << 1 << 5 << 4. << 5; +} + +void tst_QDeclarativePathView::moveModel() +{ + QFETCH(int, mode); + QFETCH(int, from); + QFETCH(int, to); + QFETCH(int, count); + QFETCH(qreal, offset); + QFETCH(int, currentIndex); + + QDeclarativeView *window = createView(); + window->show(); + + TestModel model; + model.addItem("Ben", "12345"); + model.addItem("Bohn", "2345"); + model.addItem("Bob", "54321"); + model.addItem("Bill", "4321"); + model.addItem("Jinny", "679"); + model.addItem("Milly", "73378"); + model.addItem("Jimmy", "3535"); + model.addItem("Barb", "9039"); + + QDeclarativeContext *ctxt = window->rootContext(); + ctxt->setContextProperty("testModel", &model); + + window->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview0.qml")); + qApp->processEvents(); + + QDeclarativePathView *pathview = findItem(window->rootObject(), "view"); + QVERIFY(pathview != 0); + + pathview->setHighlightRangeMode((QDeclarativePathView::HighlightRangeMode)mode); + + pathview->setCurrentIndex(4); + if (mode == QDeclarativePathView::StrictlyEnforceRange) + QTRY_COMPARE(pathview->offset(), 4.0); + else + pathview->setOffset(4); + + model.moveItems(from, to, count); + + // don't enable this test as 371b2f6947779272494b34ec44445aaad0613756 has + // not been backported to QtQuick1 so offset is still buggy +// QTRY_COMPARE(pathview->offset(), offset); + + QCOMPARE(pathview->currentIndex(), currentIndex); + + delete window; +} + void tst_QDeclarativePathView::dataModel() { QDeclarativeView *canvas = createView(); @@ -586,6 +939,20 @@ void tst_QDeclarativePathView::setCurrentIndex() QVERIFY(firstItem); QTRY_COMPARE(firstItem->pos() + offset, start); + // Test positive indexes are wrapped. + pathview->setCurrentIndex(6); + QTRY_COMPARE(pathview->currentIndex(), 2); + firstItem = findItem(pathview, "wrapper", 2); + QVERIFY(firstItem); + QTRY_COMPARE(firstItem->pos() + offset, start); + + // Test negative indexes are wrapped. + pathview->setCurrentIndex(-3); + QTRY_COMPARE(pathview->currentIndex(), 1); + firstItem = findItem(pathview, "wrapper", 1); + QVERIFY(firstItem); + QTRY_COMPARE(firstItem->pos() + offset, start); + delete canvas; } -- cgit v1.2.3 From 163b008b7531c3d5ed2b4f0403603ab4949eeb99 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Tue, 18 Dec 2012 15:26:38 +0100 Subject: test: Mark tst_qdeclarativetext as insignificant Task-number: QTBUG-21015 Change-Id: I5b0f3a607c182aec819bd525ce3b2a4f8b47791a Reviewed-by: Alan Alpert --- tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro b/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro index bd0ba7c4..64481a08 100644 --- a/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro +++ b/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro @@ -16,3 +16,5 @@ DEFINES += SRCDIR=\\\"$$PWD\\\" CONFIG += parallel_test DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 + +CONFIG += insignificant_test # QTBUG-21015 -- cgit v1.2.3 From 9238c81f79545d549b7ad4c7c849076798213a90 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 19 Dec 2012 13:47:10 +0100 Subject: Improve tst_qdeclarativetextedit. - Base on QDeclarativeDataTest to locate test data. - Make small windows frameless to prevent errors from minimum size constraints of decorated windows on Windows. - Add test messages printing the value of comparisons. - Skip alignment tests if no reference image exists: Previously, the test would create an image file name "-unknown-architecture", find out it does not exist, write out the 'actual' image under that name (clobbering the source directory) and compare to it, claiming success. The reference image name is now composed of platform and style name and the test is skipped if the file does not exist. Task-number: QTBUG-28611 Change-Id: If1496e11db9638e7febd3af637ad55d7c6f11409 Reviewed-by: Christopher Adams --- .../qdeclarativetextedit/qdeclarativetextedit.pro | 3 +- .../tst_qdeclarativetextedit.cpp | 139 ++++++++++++--------- 2 files changed, 82 insertions(+), 60 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro b/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro index 566ca6c6..d4a5e771 100644 --- a/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro +++ b/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro @@ -5,8 +5,9 @@ QT += testlib contains(QT_CONFIG,declarative): QT += declarative declarative-private gui gui-private widgets widgets-private network core-private macx:CONFIG -= app_bundle +include(../shared/qdeclarativedatatest.pri) + SOURCES += tst_qdeclarativetextedit.cpp ../shared/testhttpserver.cpp HEADERS += ../shared/testhttpserver.h -DEFINES += SRCDIR=\\\"$$PWD\\\" DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 9c899445..2d71ca4b 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -41,6 +41,7 @@ #include #include #include "../shared/testhttpserver.h" +#include #include #include #include @@ -63,20 +64,20 @@ Q_DECLARE_METATYPE(QDeclarativeTextEdit::SelectionMode) -QString createExpectedFileIfNotFound(const QString& filebasename, const QImage& actual) +// Make a widget frameless to prevent size constraints of title bars +// from interfering (Windows). +static inline void setFrameless(QWidget *w) { - // XXX This will be replaced by some clever persistent platform image store. - QString persistent_dir = SRCDIR "/data"; - QString arch = "unknown-architecture"; // QTest needs to help with this. - - QString expectfile = persistent_dir + QDir::separator() + filebasename + "-" + arch + ".png"; - - if (!QFile::exists(expectfile)) { - actual.save(expectfile); - qWarning() << "created" << expectfile; - } + Qt::WindowFlags flags = w->windowFlags(); + flags |= Qt::FramelessWindowHint; + flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); + w->setWindowFlags(flags); +} - return expectfile; +// Helper message for comparisons +static inline QByteArray msgComparison(int v1, int v2) +{ + return QByteArray::number(v1) + ' ' + QByteArray::number(v2); } void sendPreeditText(const QString &text, int cursor) @@ -90,7 +91,7 @@ void sendPreeditText(const QString &text, int cursor) } -class tst_qdeclarativetextedit : public QObject +class tst_qdeclarativetextedit : public QDeclarativeDataTest { Q_OBJECT @@ -168,6 +169,7 @@ private slots: private: void simulateKey(QDeclarativeView *, int key, Qt::KeyboardModifiers modifiers = 0); QDeclarativeView *createView(const QString &filename); + QString alignmentReferenceImage(const QString& filebasename) const; QStringList standard; QStringList richText; @@ -395,6 +397,12 @@ void tst_qdeclarativetextedit::alignments_data() QTest::newRow("CC") << int(Qt::AlignHCenter) << int(Qt::AlignVCenter) << "alignments_cc"; } +QString tst_qdeclarativetextedit::alignmentReferenceImage(const QString& filebasename) const +{ + // XXX This will be replaced by some clever persistent platform image store. + static const QString arch = QGuiApplication::platformName() + QLatin1Char('-') + qApp->style()->objectName(); + return testFile(filebasename + QLatin1Char('-') + arch + QStringLiteral(".png")); +} void tst_qdeclarativetextedit::alignments() { @@ -402,7 +410,14 @@ void tst_qdeclarativetextedit::alignments() QFETCH(int, vAlign); QFETCH(QString, expectfile); - QDeclarativeView *canvas = createView(SRCDIR "/data/alignments.qml"); + const QString referenceImage = alignmentReferenceImage(expectfile); + if (!QFile(referenceImage).exists()) + QSKIP(qPrintable(QStringLiteral("Reference image '") + + QDir::toNativeSeparators(referenceImage) + + QStringLiteral("' does not exist."))); + + QDeclarativeView *canvas = createView(testFile("alignments.qml")); + setFrameless(canvas); canvas->show(); QApplication::setActiveWindow(canvas); @@ -419,9 +434,8 @@ void tst_qdeclarativetextedit::alignments() QPainter p(&actual); canvas->render(&p); - expectfile = createExpectedFileIfNotFound(expectfile, actual); - - QImage expect(expectfile); + QImage expect(referenceImage); + QVERIFY(!expect.isNull()); QCOMPARE(actual,expect); @@ -466,7 +480,7 @@ void tst_qdeclarativetextedit::hAlign() void tst_qdeclarativetextedit::hAlign_RightToLeft() { - QDeclarativeView *canvas = createView(SRCDIR "/data/horizontalAlignment_RightToLeft.qml"); + QDeclarativeView *canvas = createView(testFile("horizontalAlignment_RightToLeft.qml")); QDeclarativeTextEdit *textEdit = canvas->rootObject()->findChild("text"); QVERIFY(textEdit != 0); canvas->show(); @@ -957,7 +971,7 @@ void tst_qdeclarativetextedit::isRightToLeft() void tst_qdeclarativetextedit::keySelection() { - QDeclarativeView *canvas = createView(SRCDIR "/data/navigation.qml"); + QDeclarativeView *canvas = createView(testFile("navigation.qml")); canvas->show(); QApplication::setActiveWindow(canvas); QVERIFY(QTest::qWaitForWindowActive(canvas)); @@ -1349,19 +1363,19 @@ void tst_qdeclarativetextedit::mouseSelection_data() QTest::addColumn("selectedText"); // import installed - QTest::newRow("on") << SRCDIR "/data/mouseselection_true.qml" << 4 << 9 << "45678"; - QTest::newRow("off") << SRCDIR "/data/mouseselection_false.qml" << 4 << 9 << QString(); - QTest::newRow("default") << SRCDIR "/data/mouseselection_default.qml" << 4 << 9 << QString(); - QTest::newRow("off word selection") << SRCDIR "/data/mouseselection_false_words.qml" << 4 << 9 << QString(); - QTest::newRow("on word selection (4,9)") << SRCDIR "/data/mouseselection_true_words.qml" << 4 << 9 << "0123456789"; - QTest::newRow("on word selection (2,13)") << SRCDIR "/data/mouseselection_true_words.qml" << 2 << 13 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - QTest::newRow("on word selection (2,30)") << SRCDIR "/data/mouseselection_true_words.qml" << 2 << 30 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - QTest::newRow("on word selection (9,13)") << SRCDIR "/data/mouseselection_true_words.qml" << 9 << 13 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - QTest::newRow("on word selection (9,30)") << SRCDIR "/data/mouseselection_true_words.qml" << 9 << 30 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - QTest::newRow("on word selection (13,2)") << SRCDIR "/data/mouseselection_true_words.qml" << 13 << 2 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - QTest::newRow("on word selection (20,2)") << SRCDIR "/data/mouseselection_true_words.qml" << 20 << 2 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - QTest::newRow("on word selection (12,9)") << SRCDIR "/data/mouseselection_true_words.qml" << 12 << 9 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - QTest::newRow("on word selection (30,9)") << SRCDIR "/data/mouseselection_true_words.qml" << 30 << 9 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + QTest::newRow("on") << testFile("mouseselection_true.qml") << 4 << 9 << "45678"; + QTest::newRow("off") << testFile("mouseselection_false.qml") << 4 << 9 << QString(); + QTest::newRow("default") << testFile("mouseselection_default.qml") << 4 << 9 << QString(); + QTest::newRow("off word selection") << testFile("mouseselection_false_words.qml") << 4 << 9 << QString(); + QTest::newRow("on word selection (4,9)") << testFile("mouseselection_true_words.qml") << 4 << 9 << "0123456789"; + QTest::newRow("on word selection (2,13)") << testFile("mouseselection_true_words.qml") << 2 << 13 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + QTest::newRow("on word selection (2,30)") << testFile("mouseselection_true_words.qml") << 2 << 30 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + QTest::newRow("on word selection (9,13)") << testFile("mouseselection_true_words.qml") << 9 << 13 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + QTest::newRow("on word selection (9,30)") << testFile("mouseselection_true_words.qml") << 9 << 30 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + QTest::newRow("on word selection (13,2)") << testFile("mouseselection_true_words.qml") << 13 << 2 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + QTest::newRow("on word selection (20,2)") << testFile("mouseselection_true_words.qml") << 20 << 2 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + QTest::newRow("on word selection (12,9)") << testFile("mouseselection_true_words.qml") << 12 << 9 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + QTest::newRow("on word selection (30,9)") << testFile("mouseselection_true_words.qml") << 30 << 9 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; } void tst_qdeclarativetextedit::mouseSelection() @@ -1403,8 +1417,7 @@ void tst_qdeclarativetextedit::mouseSelection() void tst_qdeclarativetextedit::multilineMouseSelection() { - QDeclarativeView *canvas = createView(SRCDIR "/data/mouseselection_multiline.qml"); - + QDeclarativeView *canvas = createView(testFile("mouseselection_multiline.qml")); canvas->show(); QApplication::setActiveWindow(canvas); QVERIFY(QTest::qWaitForWindowActive(canvas)); @@ -1440,8 +1453,8 @@ void tst_qdeclarativetextedit::deferEnableSelectByMouse_data() { QTest::addColumn("qmlfile"); - QTest::newRow("writable") << SRCDIR "/data/mouseselection_false.qml"; - QTest::newRow("read only") << SRCDIR "/data/mouseselection_false_readonly.qml"; + QTest::newRow("writable") << testFile("mouseselection_false.qml"); + QTest::newRow("read only") << testFile("mouseselection_false_readonly.qml"); } void tst_qdeclarativetextedit::deferEnableSelectByMouse() @@ -1480,8 +1493,8 @@ void tst_qdeclarativetextedit::deferDisableSelectByMouse_data() { QTest::addColumn("qmlfile"); - QTest::newRow("writable") << SRCDIR "/data/mouseselection_true.qml"; - QTest::newRow("read only") << SRCDIR "/data/mouseselection_true_readonly.qml"; + QTest::newRow("writable") << testFile("mouseselection_true.qml"); + QTest::newRow("read only") << testFile("mouseselection_true_readonly.qml"); } void tst_qdeclarativetextedit::deferDisableSelectByMouse() @@ -1518,7 +1531,7 @@ void tst_qdeclarativetextedit::deferDisableSelectByMouse() void tst_qdeclarativetextedit::dragMouseSelection() { - QString qmlfile = SRCDIR "/data/mouseselection_true.qml"; + QString qmlfile = testFile("mouseselection_true.qml"); QDeclarativeView *canvas = createView(qmlfile); @@ -1569,9 +1582,9 @@ void tst_qdeclarativetextedit::mouseSelectionMode_data() QTest::addColumn("selectWords"); // import installed - QTest::newRow("SelectWords") << SRCDIR "/data/mouseselectionmode_words.qml" << true; - QTest::newRow("SelectCharacters") << SRCDIR "/data/mouseselectionmode_characters.qml" << false; - QTest::newRow("default") << SRCDIR "/data/mouseselectionmode_default.qml" << false; + QTest::newRow("SelectWords") << testFile("mouseselectionmode_words.qml") << true; + QTest::newRow("SelectCharacters") << testFile("mouseselectionmode_characters.qml") << false; + QTest::newRow("default") << testFile("mouseselectionmode_default.qml") << false; } void tst_qdeclarativetextedit::mouseSelectionMode() @@ -1620,7 +1633,8 @@ void tst_qdeclarativetextedit::mouseSelectionMode() void tst_qdeclarativetextedit::inputMethodHints() { - QDeclarativeView *canvas = createView(SRCDIR "/data/inputmethodhints.qml"); + QDeclarativeView *canvas = createView(testFile("inputmethodhints.qml")); + setFrameless(canvas); canvas->show(); canvas->setFocus(); @@ -1636,8 +1650,9 @@ void tst_qdeclarativetextedit::inputMethodHints() void tst_qdeclarativetextedit::positionAt() { - QDeclarativeView *canvas = createView(SRCDIR "/data/positionAt.qml"); + QDeclarativeView *canvas = createView(testFile("positionAt.qml")); QVERIFY(canvas->rootObject() != 0); + setFrameless(canvas); canvas->show(); canvas->setFocus(); QApplication::setActiveWindow(canvas); @@ -1676,8 +1691,9 @@ void tst_qdeclarativetextedit::positionAt() int widthBegin = floor(line.cursorToX(pos - 1)); int widthEnd = ceil(line.cursorToX(pos + 1)); - QVERIFY(widthBegin <= texteditObject->width() / 2); - QVERIFY(widthEnd >= texteditObject->width() / 2); + const int halfObjectWidth = texteditObject->width() / 2; + QVERIFY2(widthBegin <= halfObjectWidth, msgComparison(widthBegin, halfObjectWidth).constData()); + QVERIFY2(widthEnd >= halfObjectWidth, msgComparison(widthEnd, halfObjectWidth).constData()); const qreal x0 = texteditObject->positionToRectangle(pos).x(); const qreal x1 = texteditObject->positionToRectangle(pos + 1).x(); @@ -1705,7 +1721,7 @@ void tst_qdeclarativetextedit::positionAt() void tst_qdeclarativetextedit::cursorDelegate() { - QDeclarativeView* view = createView(SRCDIR "/data/cursorTest.qml"); + QDeclarativeView* view = createView(testFile("cursorTest.qml")); view->show(); view->setFocus(); QDeclarativeTextEdit *textEditObject = view->rootObject()->findChild("textEditObject"); @@ -1877,9 +1893,9 @@ void tst_qdeclarativetextedit::delegateLoading() QFETCH(QString, error); TestHTTPServer server(42332); - server.serveDirectory(SRCDIR "/data/httpfail", TestHTTPServer::Disconnect); - server.serveDirectory(SRCDIR "/data/httpslow", TestHTTPServer::Delay); - server.serveDirectory(SRCDIR "/data/http"); + server.serveDirectory(testFile("httpfail"), TestHTTPServer::Disconnect); + server.serveDirectory(testFile("httpslow"), TestHTTPServer::Delay); + server.serveDirectory(testFile("http")); QDeclarativeView* view = new QDeclarativeView(0); @@ -1922,7 +1938,7 @@ the extent of the text, then they should ignore the keys. */ void tst_qdeclarativetextedit::navigation() { - QDeclarativeView *canvas = createView(SRCDIR "/data/navigation.qml"); + QDeclarativeView *canvas = createView(testFile("navigation.qml")); canvas->show(); canvas->setFocus(); @@ -2054,7 +2070,7 @@ void tst_qdeclarativetextedit::canPasteEmpty() { void tst_qdeclarativetextedit::readOnly() { - QDeclarativeView *canvas = createView(SRCDIR "/data/readOnly.qml"); + QDeclarativeView *canvas = createView(testFile("readOnly.qml")); canvas->show(); canvas->setFocus(); @@ -2297,7 +2313,7 @@ void tst_qdeclarativetextedit::openInputPanelOnFocus() void tst_qdeclarativetextedit::geometrySignals() { - QDeclarativeComponent component(&engine, SRCDIR "/data/geometrySignals.qml"); + QDeclarativeComponent component(&engine, testFile("geometrySignals.qml")); QObject *o = component.create(); QVERIFY(o); QCOMPARE(o->property("bindingWidth").toInt(), 400); @@ -2385,8 +2401,10 @@ void tst_qdeclarativetextedit::implicitSizePreedit() QInputMethodEvent event(text, QList()); QCoreApplication::sendEvent(&view, &event); - QVERIFY(textObject->width() < textObject->implicitWidth()); - QVERIFY(textObject->height() == textObject->implicitHeight()); + QVERIFY2(textObject->width() < textObject->implicitWidth(), + msgComparison(textObject->width(), textObject->implicitWidth()).constData()); + QVERIFY2(textObject->height() == textObject->implicitHeight(), + msgComparison(textObject->height(), textObject->implicitHeight()).constData()); qreal wrappedHeight = textObject->height(); textObject->resetWidth(); @@ -2484,7 +2502,8 @@ void tst_qdeclarativetextedit::preeditMicroFocus() ic.clear(); sendPreeditText(preeditText, i); currentRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect(); - QVERIFY(previousRect.left() < currentRect.left()); + QVERIFY2(previousRect.left() < currentRect.left(), + msgComparison(previousRect.left(), currentRect.left()).constData()); #if defined(Q_WS_X11) QVERIFY(ic.updateCallCount > 0); #endif @@ -2592,7 +2611,8 @@ void tst_qdeclarativetextedit::inputMethodComposing() void tst_qdeclarativetextedit::cursorRectangleSize() { - QDeclarativeView *canvas = createView(SRCDIR "/data/CursorRect.qml"); + QDeclarativeView *canvas = createView(testFile("CursorRect.qml")); + setFrameless(canvas); QVERIFY(canvas->rootObject() != 0); canvas->show(); canvas->setFocus(); @@ -2601,7 +2621,7 @@ void tst_qdeclarativetextedit::cursorRectangleSize() QDeclarativeTextEdit *textEdit = qobject_cast(canvas->rootObject()); QVERIFY(textEdit != 0); - textEdit->setFocus(Qt::OtherFocusReason); + textEdit->setFocus(true); QRectF cursorRect = textEdit->positionToRectangle(textEdit->cursorPosition()); QRectF microFocusFromScene = canvas->scene()->inputMethodQuery(Qt::ImMicroFocus).toRectF(); QRectF microFocusFromApp= QApplication::focusWidget()->inputMethodQuery(Qt::ImMicroFocus).toRectF(); @@ -2612,7 +2632,8 @@ void tst_qdeclarativetextedit::cursorRectangleSize() void tst_qdeclarativetextedit::deselect() { - QDeclarativeView *canvas = createView(SRCDIR "/data/CursorRect.qml"); + QDeclarativeView *canvas = createView(testFile("CursorRect.qml")); + setFrameless(canvas); QVERIFY(canvas->rootObject() != 0); canvas->show(); canvas->setFocus(); -- cgit v1.2.3