summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2009-05-12 12:22:52 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2009-05-12 12:22:52 (GMT)
commitbcbe1c3438f38087b16465f5b5aeac5d54a42d40 (patch)
treed939e5eb97c676fd8202595f405bcd8b0170175c /tests/auto
parent1099908428c594d67fe1da740126f4acfcdc8a0a (diff)
parentc711885b5694a51f0c22908e57e74c60188bd879 (diff)
downloadQt-bcbe1c3438f38087b16465f5b5aeac5d54a42d40.zip
Qt-bcbe1c3438f38087b16465f5b5aeac5d54a42d40.tar.gz
Qt-bcbe1c3438f38087b16465f5b5aeac5d54a42d40.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-declarativeui
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/q3accel/q3accel.pro1
-rw-r--r--tests/auto/q3action/q3action.pro1
-rw-r--r--tests/auto/q3actiongroup/q3actiongroup.pro1
-rw-r--r--tests/auto/q3buttongroup/clickLock/clickLock.pro3
-rw-r--r--tests/auto/q3buttongroup/tst_q3buttongroup.pro1
-rw-r--r--tests/auto/q3canvas/q3canvas.pro1
-rw-r--r--tests/auto/q3checklistitem/q3checklistitem.pro1
-rw-r--r--tests/auto/q3combobox/q3combobox.pro1
-rw-r--r--tests/auto/q3cstring/q3cstring.pro1
-rw-r--r--tests/auto/q3databrowser/q3databrowser.pro1
-rw-r--r--tests/auto/q3dateedit/q3dateedit.pro1
-rw-r--r--tests/auto/q3datetimeedit/q3datetimeedit.pro1
-rw-r--r--tests/auto/q3deepcopy/q3deepcopy.pro1
-rw-r--r--tests/auto/q3dict/q3dict.pro1
-rw-r--r--tests/auto/q3dns/q3dns.pro1
-rw-r--r--tests/auto/q3dockwindow/q3dockwindow.pro1
-rw-r--r--tests/auto/q3filedialog/q3filedialog.pro1
-rw-r--r--tests/auto/q3frame/q3frame.pro1
-rw-r--r--tests/auto/q3groupbox/q3groupbox.pro1
-rw-r--r--tests/auto/q3hbox/q3hbox.pro1
-rw-r--r--tests/auto/q3header/q3header.pro1
-rw-r--r--tests/auto/q3iconview/q3iconview.pro1
-rw-r--r--tests/auto/q3listbox/q3listbox.pro3
-rw-r--r--tests/auto/q3listview/q3listview.pro1
-rw-r--r--tests/auto/q3listviewitemiterator/q3listviewitemiterator.pro1
-rw-r--r--tests/auto/q3mainwindow/q3mainwindow.pro1
-rw-r--r--tests/auto/q3popupmenu/q3popupmenu.pro1
-rw-r--r--tests/auto/q3process/q3process.pro1
-rw-r--r--tests/auto/q3process/tst/tst.pro3
-rw-r--r--tests/auto/q3progressbar/q3progressbar.pro1
-rw-r--r--tests/auto/q3progressdialog/q3progressdialog.pro1
-rw-r--r--tests/auto/q3ptrlist/q3ptrlist.pro1
-rw-r--r--tests/auto/q3richtext/q3richtext.pro1
-rw-r--r--tests/auto/q3scrollview/q3scrollview.pro3
-rw-r--r--tests/auto/q3semaphore/q3semaphore.pro1
-rw-r--r--tests/auto/q3serversocket/q3serversocket.pro1
-rw-r--r--tests/auto/q3socket/q3socket.pro1
-rw-r--r--tests/auto/q3socketdevice/q3socketdevice.pro1
-rw-r--r--tests/auto/q3sqlcursor/q3sqlcursor.pro1
-rw-r--r--tests/auto/q3sqlselectcursor/q3sqlselectcursor.pro1
-rw-r--r--tests/auto/q3stylesheet/q3stylesheet.pro1
-rw-r--r--tests/auto/q3tabdialog/q3tabdialog.pro1
-rw-r--r--tests/auto/q3table/q3table.pro1
-rw-r--r--tests/auto/q3textbrowser/q3textbrowser.pro1
-rw-r--r--tests/auto/q3textedit/q3textedit.pro1
-rw-r--r--tests/auto/q3textstream/q3textstream.pro1
-rw-r--r--tests/auto/q3timeedit/q3timeedit.pro1
-rw-r--r--tests/auto/q3toolbar/q3toolbar.pro1
-rw-r--r--tests/auto/q3uridrag/q3uridrag.pro3
-rw-r--r--tests/auto/q3urloperator/q3urloperator.pro3
-rw-r--r--tests/auto/q3valuelist/q3valuelist.pro3
-rw-r--r--tests/auto/q3valuevector/q3valuevector.pro3
-rw-r--r--tests/auto/q3widgetstack/q3widgetstack.pro3
-rw-r--r--tests/auto/qcompleter/tst_qcompleter.cpp46
-rw-r--r--tests/auto/qprinter/tst_qprinter.cpp18
-rw-r--r--tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp33
-rw-r--r--tests/auto/qsqldatabase/tst_qsqldatabase.cpp19
-rw-r--r--tests/auto/qsslsocket/tst_qsslsocket.cpp2
-rw-r--r--tests/auto/qtemporaryfile/qtemporaryfile.pro3
-rw-r--r--tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp45
-rw-r--r--tests/auto/qtextdocument/tst_qtextdocument.cpp18
-rw-r--r--tests/auto/qtreewidget/tst_qtreewidget.cpp20
-rw-r--r--tests/auto/qxmlstream/XML-Test-Suite-LICENSE.txt59
-rw-r--r--tests/auto/utf8/tst_utf8.cpp309
-rw-r--r--tests/auto/utf8/utf8.pro3
65 files changed, 631 insertions, 15 deletions
diff --git a/tests/auto/q3accel/q3accel.pro b/tests/auto/q3accel/q3accel.pro
index 002033f..61d4f38 100644
--- a/tests/auto/q3accel/q3accel.pro
+++ b/tests/auto/q3accel/q3accel.pro
@@ -3,6 +3,7 @@ HEADERS +=
SOURCES += tst_q3accel.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3action/q3action.pro b/tests/auto/q3action/q3action.pro
index ee5d780..c85a158 100644
--- a/tests/auto/q3action/q3action.pro
+++ b/tests/auto/q3action/q3action.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
SOURCES += tst_q3action.cpp
diff --git a/tests/auto/q3actiongroup/q3actiongroup.pro b/tests/auto/q3actiongroup/q3actiongroup.pro
index bfe1f68..139e48c 100644
--- a/tests/auto/q3actiongroup/q3actiongroup.pro
+++ b/tests/auto/q3actiongroup/q3actiongroup.pro
@@ -1,5 +1,6 @@
load(qttest_p4)
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
SOURCES += tst_q3actiongroup.cpp
diff --git a/tests/auto/q3buttongroup/clickLock/clickLock.pro b/tests/auto/q3buttongroup/clickLock/clickLock.pro
index 68f5ed2..a1aa105 100644
--- a/tests/auto/q3buttongroup/clickLock/clickLock.pro
+++ b/tests/auto/q3buttongroup/clickLock/clickLock.pro
@@ -3,7 +3,8 @@ TEMPLATE = app
win32:TARGET = ../clickLock
!win32:TARGET = clickLock
-contains(QT_CONFIG, qt3support): QT += qt3support
+QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
DEPENDPATH += .
INCLUDEPATH += .
CONFIG -= app_bundle
diff --git a/tests/auto/q3buttongroup/tst_q3buttongroup.pro b/tests/auto/q3buttongroup/tst_q3buttongroup.pro
index 8ec25d0..9f1f090 100644
--- a/tests/auto/q3buttongroup/tst_q3buttongroup.pro
+++ b/tests/auto/q3buttongroup/tst_q3buttongroup.pro
@@ -1,5 +1,6 @@
load(qttest_p4)
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
# Input
SOURCES += tst_q3buttongroup.cpp
diff --git a/tests/auto/q3canvas/q3canvas.pro b/tests/auto/q3canvas/q3canvas.pro
index cac538d..70e9b88 100644
--- a/tests/auto/q3canvas/q3canvas.pro
+++ b/tests/auto/q3canvas/q3canvas.pro
@@ -3,5 +3,6 @@ SOURCES += tst_q3canvas.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3checklistitem/q3checklistitem.pro b/tests/auto/q3checklistitem/q3checklistitem.pro
index 77d96e8..9ae9c55 100644
--- a/tests/auto/q3checklistitem/q3checklistitem.pro
+++ b/tests/auto/q3checklistitem/q3checklistitem.pro
@@ -3,5 +3,6 @@ SOURCES += tst_q3checklistitem.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3combobox/q3combobox.pro b/tests/auto/q3combobox/q3combobox.pro
index 2391f6c..7dcde2b 100644
--- a/tests/auto/q3combobox/q3combobox.pro
+++ b/tests/auto/q3combobox/q3combobox.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_q3combobox.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3cstring/q3cstring.pro b/tests/auto/q3cstring/q3cstring.pro
index 78077b8..1171093 100644
--- a/tests/auto/q3cstring/q3cstring.pro
+++ b/tests/auto/q3cstring/q3cstring.pro
@@ -3,5 +3,6 @@ SOURCES += tst_q3cstring.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3databrowser/q3databrowser.pro b/tests/auto/q3databrowser/q3databrowser.pro
index 09c16b7..d65a5ef 100644
--- a/tests/auto/q3databrowser/q3databrowser.pro
+++ b/tests/auto/q3databrowser/q3databrowser.pro
@@ -2,5 +2,6 @@ load(qttest_p4)
SOURCES += tst_q3databrowser.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3dateedit/q3dateedit.pro b/tests/auto/q3dateedit/q3dateedit.pro
index ba585ce..85e0ebf 100644
--- a/tests/auto/q3dateedit/q3dateedit.pro
+++ b/tests/auto/q3dateedit/q3dateedit.pro
@@ -1,6 +1,7 @@
load(qttest_p4)
SOURCES += tst_q3dateedit.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3datetimeedit/q3datetimeedit.pro b/tests/auto/q3datetimeedit/q3datetimeedit.pro
index f2c0097..9c980be 100644
--- a/tests/auto/q3datetimeedit/q3datetimeedit.pro
+++ b/tests/auto/q3datetimeedit/q3datetimeedit.pro
@@ -4,6 +4,7 @@
load(qttest_p4)
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
SOURCES += tst_q3datetimeedit.cpp
diff --git a/tests/auto/q3deepcopy/q3deepcopy.pro b/tests/auto/q3deepcopy/q3deepcopy.pro
index 04e0690..9ac1a10 100644
--- a/tests/auto/q3deepcopy/q3deepcopy.pro
+++ b/tests/auto/q3deepcopy/q3deepcopy.pro
@@ -3,5 +3,6 @@ SOURCES += tst_q3deepcopy.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3dict/q3dict.pro b/tests/auto/q3dict/q3dict.pro
index 5ccd875..7bbea61 100644
--- a/tests/auto/q3dict/q3dict.pro
+++ b/tests/auto/q3dict/q3dict.pro
@@ -3,5 +3,6 @@ SOURCES += tst_q3dict.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3dns/q3dns.pro b/tests/auto/q3dns/q3dns.pro
index 10c24e5..7fd2e4c 100644
--- a/tests/auto/q3dns/q3dns.pro
+++ b/tests/auto/q3dns/q3dns.pro
@@ -3,5 +3,6 @@ SOURCES += tst_q3dns.cpp
QT += network qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3dockwindow/q3dockwindow.pro b/tests/auto/q3dockwindow/q3dockwindow.pro
index 5f23c40..1352123 100644
--- a/tests/auto/q3dockwindow/q3dockwindow.pro
+++ b/tests/auto/q3dockwindow/q3dockwindow.pro
@@ -3,6 +3,7 @@ HEADERS +=
SOURCES += tst_q3dockwindow.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3filedialog/q3filedialog.pro b/tests/auto/q3filedialog/q3filedialog.pro
index 2394111..f57f9c0 100644
--- a/tests/auto/q3filedialog/q3filedialog.pro
+++ b/tests/auto/q3filedialog/q3filedialog.pro
@@ -4,6 +4,7 @@
load(qttest_p4)
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
SOURCES += tst_q3filedialog.cpp
diff --git a/tests/auto/q3frame/q3frame.pro b/tests/auto/q3frame/q3frame.pro
index 7f0d24f..1d1f5a7 100644
--- a/tests/auto/q3frame/q3frame.pro
+++ b/tests/auto/q3frame/q3frame.pro
@@ -1,4 +1,5 @@
load(qttest_p4)
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
SOURCES += tst_q3frame.cpp
diff --git a/tests/auto/q3groupbox/q3groupbox.pro b/tests/auto/q3groupbox/q3groupbox.pro
index 5153a25..fd4cced 100644
--- a/tests/auto/q3groupbox/q3groupbox.pro
+++ b/tests/auto/q3groupbox/q3groupbox.pro
@@ -1,5 +1,6 @@
load(qttest_p4)
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
# Input
SOURCES += tst_q3groupbox.cpp
diff --git a/tests/auto/q3hbox/q3hbox.pro b/tests/auto/q3hbox/q3hbox.pro
index d5b7c65..bbd7f5b 100644
--- a/tests/auto/q3hbox/q3hbox.pro
+++ b/tests/auto/q3hbox/q3hbox.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
SOURCES += tst_q3hbox.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3header/q3header.pro b/tests/auto/q3header/q3header.pro
index 64ffb0f..d1a913a 100644
--- a/tests/auto/q3header/q3header.pro
+++ b/tests/auto/q3header/q3header.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
SOURCES += tst_q3header.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3iconview/q3iconview.pro b/tests/auto/q3iconview/q3iconview.pro
index 37a138b..9416c08 100644
--- a/tests/auto/q3iconview/q3iconview.pro
+++ b/tests/auto/q3iconview/q3iconview.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
SOURCES += tst_q3iconview.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3listbox/q3listbox.pro b/tests/auto/q3listbox/q3listbox.pro
index d193ace..dc2d197 100644
--- a/tests/auto/q3listbox/q3listbox.pro
+++ b/tests/auto/q3listbox/q3listbox.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
SOURCES += tst_qlistbox.cpp
-contains(QT_CONFIG, qt3support): QT += qt3support
+QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3listview/q3listview.pro b/tests/auto/q3listview/q3listview.pro
index 56c62d1..5d72ea6 100644
--- a/tests/auto/q3listview/q3listview.pro
+++ b/tests/auto/q3listview/q3listview.pro
@@ -2,4 +2,5 @@ load(qttest_p4)
SOURCES += tst_q3listview.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3listviewitemiterator/q3listviewitemiterator.pro b/tests/auto/q3listviewitemiterator/q3listviewitemiterator.pro
index 143e0c0..b50d012 100644
--- a/tests/auto/q3listviewitemiterator/q3listviewitemiterator.pro
+++ b/tests/auto/q3listviewitemiterator/q3listviewitemiterator.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
SOURCES += tst_q3listviewitemiterator.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3mainwindow/q3mainwindow.pro b/tests/auto/q3mainwindow/q3mainwindow.pro
index 7a198d1..c4cb7c4 100644
--- a/tests/auto/q3mainwindow/q3mainwindow.pro
+++ b/tests/auto/q3mainwindow/q3mainwindow.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
SOURCES += tst_q3mainwindow.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
CONFIG += console
diff --git a/tests/auto/q3popupmenu/q3popupmenu.pro b/tests/auto/q3popupmenu/q3popupmenu.pro
index c9c0dd5..216722b 100644
--- a/tests/auto/q3popupmenu/q3popupmenu.pro
+++ b/tests/auto/q3popupmenu/q3popupmenu.pro
@@ -4,5 +4,6 @@
load(qttest_p4)
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
SOURCES += tst_q3popupmenu.cpp
diff --git a/tests/auto/q3process/q3process.pro b/tests/auto/q3process/q3process.pro
index 8dc3541..a665c2b 100644
--- a/tests/auto/q3process/q3process.pro
+++ b/tests/auto/q3process/q3process.pro
@@ -5,6 +5,7 @@ SUBDIRS = cat \
tst
TARGET = tst_q3process
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
#no install rule for subdir
INSTALLS =
diff --git a/tests/auto/q3process/tst/tst.pro b/tests/auto/q3process/tst/tst.pro
index 090d76b..359148b 100644
--- a/tests/auto/q3process/tst/tst.pro
+++ b/tests/auto/q3process/tst/tst.pro
@@ -11,6 +11,7 @@ win32 {
}
}
-contains(QT_CONFIG, qt3support): QT += qt3support
+QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3progressbar/q3progressbar.pro b/tests/auto/q3progressbar/q3progressbar.pro
index b3c8864..582c39e 100644
--- a/tests/auto/q3progressbar/q3progressbar.pro
+++ b/tests/auto/q3progressbar/q3progressbar.pro
@@ -4,6 +4,7 @@
load(qttest_p4)
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
SOURCES += tst_q3progressbar.cpp
diff --git a/tests/auto/q3progressdialog/q3progressdialog.pro b/tests/auto/q3progressdialog/q3progressdialog.pro
index 65e24ed..08528db 100644
--- a/tests/auto/q3progressdialog/q3progressdialog.pro
+++ b/tests/auto/q3progressdialog/q3progressdialog.pro
@@ -4,6 +4,7 @@
load(qttest_p4)
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
SOURCES += tst_q3progressdialog.cpp
diff --git a/tests/auto/q3ptrlist/q3ptrlist.pro b/tests/auto/q3ptrlist/q3ptrlist.pro
index 186a707..d7431f4 100644
--- a/tests/auto/q3ptrlist/q3ptrlist.pro
+++ b/tests/auto/q3ptrlist/q3ptrlist.pro
@@ -2,5 +2,6 @@ load(qttest_p4)
SOURCES += tst_q3ptrlist.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3richtext/q3richtext.pro b/tests/auto/q3richtext/q3richtext.pro
index 2d4fc5a..e22fa37 100644
--- a/tests/auto/q3richtext/q3richtext.pro
+++ b/tests/auto/q3richtext/q3richtext.pro
@@ -3,6 +3,7 @@ HEADERS +=
SOURCES += tst_q3richtext.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3scrollview/q3scrollview.pro b/tests/auto/q3scrollview/q3scrollview.pro
index 1750e8b..d98d234 100644
--- a/tests/auto/q3scrollview/q3scrollview.pro
+++ b/tests/auto/q3scrollview/q3scrollview.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
SOURCES += tst_qscrollview.cpp
-contains(QT_CONFIG, qt3support): QT += qt3support
+QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3semaphore/q3semaphore.pro b/tests/auto/q3semaphore/q3semaphore.pro
index ad8c154..935917d 100644
--- a/tests/auto/q3semaphore/q3semaphore.pro
+++ b/tests/auto/q3semaphore/q3semaphore.pro
@@ -1,5 +1,6 @@
load(qttest_p4)
SOURCES += tst_q3semaphore.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3serversocket/q3serversocket.pro b/tests/auto/q3serversocket/q3serversocket.pro
index 4fa9dce..4e5e364 100644
--- a/tests/auto/q3serversocket/q3serversocket.pro
+++ b/tests/auto/q3serversocket/q3serversocket.pro
@@ -3,5 +3,6 @@ SOURCES += tst_q3serversocket.cpp
QT += network qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3socket/q3socket.pro b/tests/auto/q3socket/q3socket.pro
index a9bf0c0..a8324e9 100644
--- a/tests/auto/q3socket/q3socket.pro
+++ b/tests/auto/q3socket/q3socket.pro
@@ -2,5 +2,6 @@ load(qttest_p4)
SOURCES += tst_qsocket.cpp
QT += network qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3socketdevice/q3socketdevice.pro b/tests/auto/q3socketdevice/q3socketdevice.pro
index c6e9e93..d2cbfb2 100644
--- a/tests/auto/q3socketdevice/q3socketdevice.pro
+++ b/tests/auto/q3socketdevice/q3socketdevice.pro
@@ -2,5 +2,6 @@ load(qttest_p4)
SOURCES += tst_q3socketdevice.cpp
QT += network qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3sqlcursor/q3sqlcursor.pro b/tests/auto/q3sqlcursor/q3sqlcursor.pro
index 2844540..2d316fb 100644
--- a/tests/auto/q3sqlcursor/q3sqlcursor.pro
+++ b/tests/auto/q3sqlcursor/q3sqlcursor.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
SOURCES += tst_q3sqlcursor.cpp
QT += sql qt3support
+requires(contains(QT_CONFIG,qt3support))
win32:LIBS += -lws2_32
diff --git a/tests/auto/q3sqlselectcursor/q3sqlselectcursor.pro b/tests/auto/q3sqlselectcursor/q3sqlselectcursor.pro
index 21e311f..59448eb 100644
--- a/tests/auto/q3sqlselectcursor/q3sqlselectcursor.pro
+++ b/tests/auto/q3sqlselectcursor/q3sqlselectcursor.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
SOURCES += tst_q3sqlselectcursor.cpp
QT += sql qt3support
+requires(contains(QT_CONFIG,qt3support))
win32:LIBS += -lws2_32
diff --git a/tests/auto/q3stylesheet/q3stylesheet.pro b/tests/auto/q3stylesheet/q3stylesheet.pro
index a5e8438..f0fcd8b 100644
--- a/tests/auto/q3stylesheet/q3stylesheet.pro
+++ b/tests/auto/q3stylesheet/q3stylesheet.pro
@@ -4,6 +4,7 @@
load(qttest_p4)
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
SOURCES += tst_q3stylesheet.cpp
diff --git a/tests/auto/q3tabdialog/q3tabdialog.pro b/tests/auto/q3tabdialog/q3tabdialog.pro
index 1ba72f9..815510d 100644
--- a/tests/auto/q3tabdialog/q3tabdialog.pro
+++ b/tests/auto/q3tabdialog/q3tabdialog.pro
@@ -4,6 +4,7 @@
load(qttest_p4)
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
SOURCES += tst_q3tabdialog.cpp
diff --git a/tests/auto/q3table/q3table.pro b/tests/auto/q3table/q3table.pro
index 6d96a4e..bdda8ba 100644
--- a/tests/auto/q3table/q3table.pro
+++ b/tests/auto/q3table/q3table.pro
@@ -2,5 +2,6 @@ load(qttest_p4)
SOURCES += tst_q3table.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3textbrowser/q3textbrowser.pro b/tests/auto/q3textbrowser/q3textbrowser.pro
index 8ddeaba..4dfd12e 100644
--- a/tests/auto/q3textbrowser/q3textbrowser.pro
+++ b/tests/auto/q3textbrowser/q3textbrowser.pro
@@ -3,6 +3,7 @@ HEADERS +=
SOURCES += tst_q3textbrowser.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3textedit/q3textedit.pro b/tests/auto/q3textedit/q3textedit.pro
index a4b24a9..ff90c4a 100644
--- a/tests/auto/q3textedit/q3textedit.pro
+++ b/tests/auto/q3textedit/q3textedit.pro
@@ -4,5 +4,6 @@ SOURCES += tst_q3textedit.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3textstream/q3textstream.pro b/tests/auto/q3textstream/q3textstream.pro
index 7c80af7..bf2584a 100644
--- a/tests/auto/q3textstream/q3textstream.pro
+++ b/tests/auto/q3textstream/q3textstream.pro
@@ -1,6 +1,7 @@
load(qttest_p4)
SOURCES += tst_q3textstream.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
MOC_DIR=tmp
diff --git a/tests/auto/q3timeedit/q3timeedit.pro b/tests/auto/q3timeedit/q3timeedit.pro
index 17b4a84..0f231df 100644
--- a/tests/auto/q3timeedit/q3timeedit.pro
+++ b/tests/auto/q3timeedit/q3timeedit.pro
@@ -1,6 +1,7 @@
load(qttest_p4)
SOURCES += tst_q3timeedit.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3toolbar/q3toolbar.pro b/tests/auto/q3toolbar/q3toolbar.pro
index 8fcab99..974f14f 100644
--- a/tests/auto/q3toolbar/q3toolbar.pro
+++ b/tests/auto/q3toolbar/q3toolbar.pro
@@ -1,6 +1,7 @@
load(qttest_p4)
SOURCES += tst_q3toolbar.cpp
QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3uridrag/q3uridrag.pro b/tests/auto/q3uridrag/q3uridrag.pro
index 526623e..b6e77fc 100644
--- a/tests/auto/q3uridrag/q3uridrag.pro
+++ b/tests/auto/q3uridrag/q3uridrag.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
SOURCES += tst_q3uridrag.cpp
-contains(QT_CONFIG, qt3support): QT += qt3support
+QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3urloperator/q3urloperator.pro b/tests/auto/q3urloperator/q3urloperator.pro
index 3364dac..29282eb 100644
--- a/tests/auto/q3urloperator/q3urloperator.pro
+++ b/tests/auto/q3urloperator/q3urloperator.pro
@@ -2,7 +2,8 @@ load(qttest_p4)
SOURCES += tst_q3urloperator.cpp
-contains(QT_CONFIG, qt3support): QT += qt3support
+QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
QT += network
diff --git a/tests/auto/q3valuelist/q3valuelist.pro b/tests/auto/q3valuelist/q3valuelist.pro
index ab82d31..d359779 100644
--- a/tests/auto/q3valuelist/q3valuelist.pro
+++ b/tests/auto/q3valuelist/q3valuelist.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
SOURCES += tst_q3valuelist.cpp
-contains(QT_CONFIG, qt3support): QT += qt3support
+QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3valuevector/q3valuevector.pro b/tests/auto/q3valuevector/q3valuevector.pro
index 883fda2..55956cb 100644
--- a/tests/auto/q3valuevector/q3valuevector.pro
+++ b/tests/auto/q3valuevector/q3valuevector.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
SOURCES += tst_q3valuevector.cpp
-contains(QT_CONFIG, qt3support): QT += qt3support
+QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/q3widgetstack/q3widgetstack.pro b/tests/auto/q3widgetstack/q3widgetstack.pro
index 9783f58..1bd6a89 100644
--- a/tests/auto/q3widgetstack/q3widgetstack.pro
+++ b/tests/auto/q3widgetstack/q3widgetstack.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
SOURCES += tst_q3widgetstack.cpp
-contains(QT_CONFIG, qt3support): QT += qt3support
+QT += qt3support
+requires(contains(QT_CONFIG,qt3support))
diff --git a/tests/auto/qcompleter/tst_qcompleter.cpp b/tests/auto/qcompleter/tst_qcompleter.cpp
index 656995a..b71cdc6 100644
--- a/tests/auto/qcompleter/tst_qcompleter.cpp
+++ b/tests/auto/qcompleter/tst_qcompleter.cpp
@@ -143,6 +143,9 @@ private slots:
void task246056_setCompletionPrefix();
void task250064_lostFocus();
+ void task253125_lineEditCompletion_data();
+ void task253125_lineEditCompletion();
+
private:
void filter();
void testRowCount();
@@ -1184,5 +1187,48 @@ void tst_QCompleter::task250064_lostFocus()
QCOMPARE(textEdit->focusPolicy(), origPolicy);
}
+void tst_QCompleter::task253125_lineEditCompletion_data()
+{
+ QTest::addColumn<QStringList>("list");
+ QTest::addColumn<int>("completionMode");
+
+ QStringList list = QStringList()
+ << "alpha" << "beta" << "gamma" << "delta" << "epsilon" << "zeta"
+ << "eta" << "theta" << "iota" << "kappa" << "lambda" << "mu"
+ << "nu" << "xi" << "omicron" << "pi" << "rho" << "sigma"
+ << "tau" << "upsilon" << "phi" << "chi" << "psi" << "omega";
+
+ QTest::newRow("Inline") << list << (int)QCompleter::InlineCompletion;
+ QTest::newRow("Filtered") << list << (int)QCompleter::PopupCompletion;
+ QTest::newRow("Unfiltered") << list << (int)QCompleter::UnfilteredPopupCompletion;
+}
+
+void tst_QCompleter::task253125_lineEditCompletion()
+{
+ QFETCH(QStringList, list);
+ QFETCH(int, completionMode);
+
+ QStringListModel *model = new QStringListModel;
+ model->setStringList(list);
+
+ QCompleter *completer = new QCompleter(list);
+ completer->setModel(model);
+ completer->setCompletionMode((QCompleter::CompletionMode)completionMode);
+
+ QLineEdit edit;
+ edit.setCompleter(completer);
+ edit.show();
+ edit.setFocus();
+
+ QTest::qWait(100);
+
+ QTest::keyClick(&edit, 'i');
+ QCOMPARE(edit.completer()->currentCompletion(), QString("iota"));
+ QTest::keyClick(edit.completer()->popup(), Qt::Key_Down);
+ QTest::keyClick(edit.completer()->popup(), Qt::Key_Enter);
+
+ QCOMPARE(edit.text(), QString("iota"));
+}
+
QTEST_MAIN(tst_QCompleter)
#include "tst_qcompleter.moc"
diff --git a/tests/auto/qprinter/tst_qprinter.cpp b/tests/auto/qprinter/tst_qprinter.cpp
index a598bfc..cde4ae5 100644
--- a/tests/auto/qprinter/tst_qprinter.cpp
+++ b/tests/auto/qprinter/tst_qprinter.cpp
@@ -103,6 +103,7 @@ private slots:
void valuePreservation();
void errorReporting();
void testCustomPageSizes();
+ void printDialogCompleter();
private:
};
@@ -940,5 +941,22 @@ void tst_QPrinter::testCustomPageSizes()
QCOMPARE(paperSize, customSize);
}
+void tst_QPrinter::printDialogCompleter()
+{
+#if defined(QT_NO_COMPLETER) || defined(QT_NO_FILEDIALOG)
+ QSKIP("QT_NO_COMPLETER || QT_NO_FILEDIALOG: Auto-complete turned off in QPrinterDialog.", QTest::SkipAll);
+#else
+ QPrintDialog dialog;
+ dialog.printer()->setOutputFileName("file.pdf");
+ dialog.setEnabledOptions(QAbstractPrintDialog::PrintToFile);
+ dialog.show();
+
+ QTest::qWait(100);
+
+ QTest::keyClick(0, Qt::Key_Tab);
+ QTest::keyClick(0, 'P');
+#endif
+}
+
QTEST_MAIN(tst_QPrinter)
#include "tst_qprinter.moc"
diff --git a/tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp b/tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp
index 1413b0d..257ec0b 100644
--- a/tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp
+++ b/tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp
@@ -68,6 +68,7 @@ private slots:
void iterateString();
void iterateGetterSetter();
void iterateArgumentsObject();
+ void assignObjectToIterator();
void undefinedBehavior();
};
@@ -562,5 +563,37 @@ void tst_QScriptValueIterator::undefinedBehavior()
QVERIFY(it.value().isNumber());
}
+void tst_QScriptValueIterator::assignObjectToIterator()
+{
+ QScriptEngine eng;
+ QScriptValue obj1 = eng.newObject();
+ obj1.setProperty("foo", 123);
+ QScriptValue obj2 = eng.newObject();
+ obj2.setProperty("bar", 456);
+
+ QScriptValueIterator it(obj1);
+ QVERIFY(it.hasNext());
+ it.next();
+ it = obj2;
+ QVERIFY(it.hasNext());
+ it.next();
+ QCOMPARE(it.name(), QString::fromLatin1("bar"));
+
+ it = obj1;
+ QVERIFY(it.hasNext());
+ it.next();
+ QCOMPARE(it.name(), QString::fromLatin1("foo"));
+
+ it = obj2;
+ QVERIFY(it.hasNext());
+ it.next();
+ QCOMPARE(it.name(), QString::fromLatin1("bar"));
+
+ it = obj2;
+ QVERIFY(it.hasNext());
+ it.next();
+ QCOMPARE(it.name(), QString::fromLatin1("bar"));
+}
+
QTEST_MAIN(tst_QScriptValueIterator)
#include "tst_qscriptvalueiterator.moc"
diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
index 8dede12..4fa3dc4 100644
--- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
@@ -517,6 +517,8 @@ void tst_QSqlDatabase::tables()
// MySQL doesn't give back anything when calling QSqlDatabase::tables() with QSql::Views
// May be fixable by doing a select on informational_schema.views instead of using the client library api
QEXPECT_FAIL("", "MySQL driver thinks that views are tables", Continue);
+ if(!tables.contains(qTableName("qtest_view"), Qt::CaseInsensitive))
+ qDebug() << "failed to find" << qTableName("qtest_view") << "in" << tables;
QVERIFY(tables.contains(qTableName("qtest_view"), Qt::CaseInsensitive));
}
if (tempTables)
@@ -1880,17 +1882,26 @@ void tst_QSqlDatabase::ibase_procWithReturnValues()
"\nRESULT INTEGER)"
"\nAS"
"\nbegin"
- "\nRESULT = 10;"
+ "\nRESULT = 10 * ABC;"
"\nsuspend;"
"\nend"));
// Interbase procedures can be executed in two ways: EXECUTE PROCEDURE or SELECT
QVERIFY_SQL(q, exec(QString("execute procedure %1(123)").arg(procName)));
QVERIFY_SQL(q, next());
- QCOMPARE(q.value(0).toInt(), 10);
+ QCOMPARE(q.value(0).toInt(), 1230);
QVERIFY_SQL(q, exec(QString("select result from %1(456)").arg(procName)));
QVERIFY_SQL(q, next());
- QCOMPARE(q.value(0).toInt(), 10);
+ QCOMPARE(q.value(0).toInt(), 4560);
+ QVERIFY_SQL(q, prepare(QLatin1String("execute procedure ")+procName+QLatin1String("(?)")));
+ q.bindValue(0, 123);
+ QVERIFY_SQL(q, exec());
+ QVERIFY_SQL(q, next());
+ QCOMPARE(q.value(0).toInt(), 1230);
+ q.bindValue(0, 456);
+ QVERIFY_SQL(q, exec());
+ QVERIFY_SQL(q, next());
+ QCOMPARE(q.value(0).toInt(), 4560);
q.exec(QString("drop procedure %1").arg(procName));
}
@@ -2276,7 +2287,7 @@ void tst_QSqlDatabase::db2_valueCacheUpdate()
void tst_QSqlDatabase::sqlStatementUseIsNull_189093()
{
- // NULL = NULL is unknow, the sqlStatment must use IS NULL
+ // NULL = NULL is unknown, the sqlStatment must use IS NULL
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp
index b9725fd..432092a 100644
--- a/tests/auto/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp
@@ -1286,6 +1286,8 @@ protected:
// delayed start of encryption
QTest::qSleep(100);
QSslSocket *socket = server.socket;
+ Q_ASSERT(socket);
+ Q_ASSERT(socket->isValid());
socket->ignoreSslErrors();
socket->startServerEncryption();
if (!socket->waitForEncrypted(2000))
diff --git a/tests/auto/qtemporaryfile/qtemporaryfile.pro b/tests/auto/qtemporaryfile/qtemporaryfile.pro
index 0c90994..bde990a 100644
--- a/tests/auto/qtemporaryfile/qtemporaryfile.pro
+++ b/tests/auto/qtemporaryfile/qtemporaryfile.pro
@@ -2,5 +2,4 @@ load(qttest_p4)
SOURCES += tst_qtemporaryfile.cpp
QT = core
-
-
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
index f5155ae..2daa0f6 100644
--- a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
+++ b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
@@ -51,6 +51,13 @@
#if defined(Q_OS_WIN)
# include <windows.h>
#endif
+#if defined(Q_OS_UNIX)
+# include <sys/types.h>
+# include <sys/stat.h>
+# include <errno.h>
+# include <fcntl.h> // open(2)
+# include <unistd.h> // close(2)
+#endif
//TESTED_CLASS=
//TESTED_FILES=
@@ -78,6 +85,7 @@ private slots:
void openOnRootDrives();
void stressTest();
void rename();
+ void renameFdLeak();
public:
};
@@ -356,5 +364,42 @@ void tst_QTemporaryFile::rename()
QVERIFY(!dir.exists("temporary-file.txt"));
}
+void tst_QTemporaryFile::renameFdLeak()
+{
+#ifdef Q_OS_UNIX
+ // Test this on Unix only
+
+ // Open a bunch of files to force the fd count to go up
+ static const int count = 10;
+ int bunch_of_files[count];
+ for (int i = 0; i < count; ++i) {
+ bunch_of_files[i] = ::open(SRCDIR "tst_qtemporaryfile.cpp", O_RDONLY);
+ QVERIFY(bunch_of_files[i] != -1);
+ }
+
+ int fd;
+ {
+ QTemporaryFile file;
+ file.setAutoRemove(false);
+ QVERIFY(file.open());
+
+ // close the bunch of files
+ for (int i = 0; i < count; ++i)
+ ::close(bunch_of_files[i]);
+
+ // save the file descriptor for later
+ fd = file.handle();
+
+ // rename the file to something
+ QString newPath = QDir::tempPath() + "/tst_qtemporaryfile-renameFdLeak-" + QString::number(getpid());
+ file.rename(newPath);
+ QFile::remove(newPath);
+ }
+
+ // check if QTemporaryFile closed the file
+ QVERIFY(::close(fd) == -1 && errno == EBADF);
+#endif
+}
+
QTEST_MAIN(tst_QTemporaryFile)
#include "tst_qtemporaryfile.moc"
diff --git a/tests/auto/qtextdocument/tst_qtextdocument.cpp b/tests/auto/qtextdocument/tst_qtextdocument.cpp
index 4ef5299..63a172b 100644
--- a/tests/auto/qtextdocument/tst_qtextdocument.cpp
+++ b/tests/auto/qtextdocument/tst_qtextdocument.cpp
@@ -161,6 +161,8 @@ private slots:
void testUndoCommandAdded();
+ void testUndoBlocks();
+
private:
void backgroundImage_checkExpectedHtml(const QTextDocument &doc);
@@ -2435,5 +2437,21 @@ void tst_QTextDocument::testUndoCommandAdded()
QCOMPARE(spy.count(), 1);
}
+void tst_QTextDocument::testUndoBlocks()
+{
+ QVERIFY(doc);
+ cursor.insertText("Hello World");
+ cursor.insertText("period");
+ doc->undo();
+ QCOMPARE(doc->toPlainText(), QString(""));
+ cursor.insertText("Hello World");
+ cursor.insertText("One\nTwo\nThree");
+ QCOMPARE(doc->toPlainText(), QString("Hello WorldOne\nTwo\nThree"));
+ doc->undo();
+ QCOMPARE(doc->toPlainText(), QString("Hello World"));
+ doc->undo();
+ QCOMPARE(doc->toPlainText(), QString(""));
+}
+
QTEST_MAIN(tst_QTextDocument)
#include "tst_qtextdocument.moc"
diff --git a/tests/auto/qtreewidget/tst_qtreewidget.cpp b/tests/auto/qtreewidget/tst_qtreewidget.cpp
index c3595c2..906332c 100644
--- a/tests/auto/qtreewidget/tst_qtreewidget.cpp
+++ b/tests/auto/qtreewidget/tst_qtreewidget.cpp
@@ -136,6 +136,7 @@ private slots:
void rootItemFlags();
void task218661_setHeaderData();
void task245280_sortChildren();
+ void task253109_itemHeight();
// QTreeWidgetItem
void itemOperatorLessThan();
@@ -2879,6 +2880,25 @@ void tst_QTreeWidget::task245280_sortChildren()
QCOMPARE(top.child(i)->text(1), QString::number(i));
}
+void tst_QTreeWidget::task253109_itemHeight()
+{
+ QTreeWidget treeWidget;
+ treeWidget.setColumnCount(1);
+ treeWidget.show();
+ QTest::qWait(200);
+
+ QTreeWidgetItem item(&treeWidget);
+ class MyWidget : public QWidget
+ {
+ virtual QSize sizeHint() const { return QSize(200,100); }
+ } w;
+ treeWidget.setItemWidget(&item, 0, &w);
+
+ QTest::qWait(200);
+ QCOMPARE(w.geometry(), treeWidget.visualItemRect(&item));
+
+}
+
void tst_QTreeWidget::task206367_duplication()
{
QTreeWidget treeWidget;
diff --git a/tests/auto/qxmlstream/XML-Test-Suite-LICENSE.txt b/tests/auto/qxmlstream/XML-Test-Suite-LICENSE.txt
new file mode 100644
index 0000000..bd84fae
--- /dev/null
+++ b/tests/auto/qxmlstream/XML-Test-Suite-LICENSE.txt
@@ -0,0 +1,59 @@
+The XML testsuite available here is a copy of the Extensible Markup
+Language (XML) Conformance Test Suites provided by W3C. Please see
+http://www.w3.org/XML/Test/ for updates and other information.
+
+These files are licensed under the W3C Software License (19980720),
+reproduced below:
+
+---
+W3C® SOFTWARE NOTICE AND LICENSE
+
+Copyright © 1994-2002 World Wide Web Consortium, (Massachusetts
+Institute of Technology, Institut National de Recherche en
+Informatique et en Automatique, Keio University). All Rights
+Reserved. http://www.w3.org/Consortium/Legal/
+
+This W3C work (including software, documents, or other related items)
+is being provided by the copyright holders under the following
+license. By obtaining, using and/or copying this work, you (the
+licensee) agree that you have read, understood, and will comply with
+the following terms and conditions:
+
+Permission to use, copy, modify, and distribute this software and its
+documentation, with or without modification, for any purpose and
+without fee or royalty is hereby granted, provided that you include
+the following on ALL copies of the software and documentation or
+portions thereof, including modifications, that you make:
+
+ 1. The full text of this NOTICE in a location viewable to users of
+ the redistributed or derivative work.
+
+ 2. Any pre-existing intellectual property disclaimers, notices, or
+ terms and conditions. If none exist, a short notice of the
+ following form (hypertext is preferred, text is permitted) should
+ be used within the body of any redistributed or derivative code:
+ "Copyright © [$date-of-software] World Wide Web Consortium,
+ (Massachusetts Institute of Technology, Institut National de
+ Recherche en Informatique et en Automatique, Keio University). All
+ Rights Reserved. http://www.w3.org/Consortium/Legal/"
+
+ 3. Notice of any changes or modifications to the W3C files, including
+ the date changes were made. (We recommend you provide URIs to the
+ location from which the code is derived.)
+
+THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT
+HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR
+DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
+TRADEMARKS OR OTHER RIGHTS.
+
+COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL
+OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR
+DOCUMENTATION.
+
+The name and trademarks of copyright holders may NOT be used in
+advertising or publicity pertaining to the software without specific,
+written prior permission. Title to copyright in this software and any
+associated documentation will at all times remain with copyright
+holders.
diff --git a/tests/auto/utf8/tst_utf8.cpp b/tests/auto/utf8/tst_utf8.cpp
new file mode 100644
index 0000000..3aef69f
--- /dev/null
+++ b/tests/auto/utf8/tst_utf8.cpp
@@ -0,0 +1,309 @@
+/****************************************************************************
+**
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, 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.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtTest/QtTest>
+
+#include <qtextcodec.h>
+#include <qsharedpointer.h>
+
+//TESTED_CLASS=
+//TESTED_FILES=
+
+static const char utf8bom[] = "\xEF\xBB\xBF";
+
+class tst_Utf8 : public QObject
+{
+ Q_OBJECT
+
+public:
+ // test data:
+ QTextCodec *codec;
+ QString (*from8BitPtr)(const char *, int);
+ QByteArray (QString:: *to8Bit)() const;
+
+ inline QString from8Bit(const QByteArray &ba)
+ { return from8BitPtr(ba.constData(), ba.length()); }
+public slots:
+ void initTestCase();
+ void init();
+
+private slots:
+ void roundTrip_data();
+ void roundTrip();
+
+ void charByChar_data();
+ void charByChar();
+
+ void invalidUtf8_data();
+ void invalidUtf8();
+};
+
+void tst_Utf8::initTestCase()
+{
+ QTest::addColumn<bool>("useLocale");
+ QTest::newRow("utf8codec") << false;
+
+ // is the locale UTF-8?
+ if (QString(QChar(QChar::ReplacementCharacter)).toLocal8Bit() == "\xEF\xBF\xBD") {
+ QTest::newRow("localecodec") << true;
+ qDebug() << "locale is utf8";
+ }
+}
+
+void tst_Utf8::init()
+{
+ QFETCH_GLOBAL(bool, useLocale);
+ if (useLocale) {
+ codec = QTextCodec::codecForLocale();
+ from8BitPtr = &QString::fromLocal8Bit;
+ to8Bit = &QString::toLocal8Bit;
+ } else {
+ codec = QTextCodec::codecForMib(106);
+ from8BitPtr = &QString::fromUtf8;
+ to8Bit = &QString::toUtf8;
+ }
+}
+
+void tst_Utf8::roundTrip_data()
+{
+ QTest::addColumn<QByteArray>("utf8");
+ QTest::addColumn<QString>("utf16");
+
+ QTest::newRow("empty") << QByteArray() << QString();
+ QTest::newRow("nul") << QByteArray("", 1) << QString(QChar(QChar::Null));
+
+ static const char ascii[] = "This is a standard US-ASCII message";
+ QTest::newRow("ascii") << QByteArray(ascii) << ascii;
+
+ static const char ascii2[] = "\1This\2is\3an\4US-ASCII\020 message interspersed with control chars";
+ QTest::newRow("ascii2") << QByteArray(ascii2) << ascii2;
+
+ static const char utf8_1[] = "\302\240"; // NBSP
+ QTest::newRow("utf8_1") << QByteArray(utf8_1) << QString(QChar(QChar::Nbsp));
+
+ static const char utf8_2[] = "\342\202\254"; // Euro symbol
+ QTest::newRow("utf8_2") << QByteArray(utf8_2) << QString(QChar(0x20AC));
+
+#if 0
+ // Can't test this because QString::fromUtf8 consumes it
+ static const char utf8_3[] = "\357\273\277"; // byte order mark
+ QTest::newRow("utf8_3") << QByteArray(utf8_3) << QString(QChar(QChar::ByteOrderMark));
+#endif
+
+ static const char utf8_4[] = "\357\277\275"; // replacement char
+ QTest::newRow("utf8_4") << QByteArray(utf8_4) << QString(QChar(QChar::ReplacementCharacter));
+
+ static const char utf8_5[] = "\360\220\210\203"; // U+010203
+ static const uint utf32_5[] = { 0x010203 };
+ QTest::newRow("utf8_5") << QByteArray(utf8_5) << QString::fromUcs4(utf32_5, 1);
+
+ static const char utf8_6[] = "\364\217\277\277"; // U+10FFFF
+ static const uint utf32_6[] = { 0x10FFFF };
+ QTest::newRow("utf8_6") << QByteArray(utf8_6) << QString::fromUcs4(utf32_6, 1);
+
+ static const char utf8_7[] = "abc\302\240\303\241\303\251\307\275 \342\202\254def";
+ static const ushort utf16_7[] = { 'a', 'b', 'c', 0x00A0,
+ 0x00E1, 0x00E9, 0x01FD,
+ ' ', 0x20AC, 'd', 'e', 'f', 0 };
+ QTest::newRow("utf8_7") << QByteArray(utf8_7) << QString::fromUtf16(utf16_7);
+
+ static const char utf8_8[] = "abc\302\240\303\241\303\251\307\275 \364\217\277\277 \342\202\254def";
+ static const uint utf32_8[] = { 'a', 'b', 'c', 0x00A0,
+ 0x00E1, 0x00E9, 0x01FD,
+ ' ', 0x10FFFF, ' ',
+ 0x20AC, 'd', 'e', 'f', 0 };
+ QTest::newRow("utf8_8") << QByteArray(utf8_8) << QString::fromUcs4(utf32_8);
+}
+
+void tst_Utf8::roundTrip()
+{
+ QFETCH(QByteArray, utf8);
+ QFETCH(QString, utf16);
+
+ QCOMPARE((utf16.*to8Bit)(), utf8);
+ QCOMPARE(from8Bit(utf8), utf16);
+
+ QCOMPARE((from8Bit(utf8).*to8Bit)(), utf8);
+ QCOMPARE(from8Bit((utf16.*to8Bit)()), utf16);
+}
+
+void tst_Utf8::charByChar_data()
+{
+ roundTrip_data();
+}
+
+void tst_Utf8::charByChar()
+{
+ QFETCH(QByteArray, utf8);
+ QFETCH(QString, utf16);
+
+ {
+ // from utf16 to utf8 char by char:
+ QSharedPointer<QTextEncoder> encoder = QSharedPointer<QTextEncoder>(codec->makeEncoder());
+ QByteArray encoded;
+
+ for (int i = 0; i < utf16.length(); ++i) {
+ encoded += encoder->fromUnicode(utf16.constData() + i, 1);
+ QVERIFY(!encoder->hasFailure());
+ }
+
+ if (encoded.startsWith(utf8bom))
+ encoded = encoded.mid(strlen(utf8bom));
+ QCOMPARE(encoded, utf8);
+ }
+ {
+ // from utf8 to utf16 char by char:
+ QSharedPointer<QTextDecoder> decoder = QSharedPointer<QTextDecoder>(codec->makeDecoder());
+ QString decoded;
+
+ for (int i = 0; i < utf8.length(); ++i) {
+ decoded += decoder->toUnicode(utf8.constData() + i, 1);
+ QVERIFY(!decoder->hasFailure());
+ }
+
+ QCOMPARE(decoded, utf16);
+ }
+}
+
+void tst_Utf8::invalidUtf8_data()
+{
+ QTest::addColumn<QByteArray>("utf8");
+
+ QTest::newRow("1char") << QByteArray("\x80");
+ QTest::newRow("2chars") << QByteArray("\xC2\xC0");
+ QTest::newRow("3chars-1") << QByteArray("\xE0\xA0\xC0");
+ QTest::newRow("3chars-2") << QByteArray("\xE0\xC0\xA0");
+ QTest::newRow("4chars-1") << QByteArray("\xF0\x90\x80\xC0");
+ QTest::newRow("4chars-2") << QByteArray("\xF0\x90\xC0\x80");
+ QTest::newRow("4chars-3") << QByteArray("\xF0\xC0\x80\x80");
+
+ // U+FFFE and U+FFFF are non-characters and must not be present
+ // U+FFFE: 1111 11 1111 11 1110
+ // encoding: xxxz:1111 xz11:1111 xz11:1110
+ QTest::newRow("fffe") << QByteArray("\xEF\xBF\xBE");
+ // U+FFFF: 1111 11 1111 11 1111
+ // encoding: xxxz:1111 xz11:1111 xz11:1111
+ QTest::newRow("ffff") << QByteArray("\xEF\xBF\xBF");
+
+ // Surrogate pairs must now be present either
+ // U+D800: 1101 10 0000 00 0000
+ // encoding: xxxz:1101 xz10:0000 xz00:0000
+ QTest::newRow("hi-surrogate") << QByteArray("\xED\xA0\x80");
+ // U+DC00: 1101 11 0000 00 0000
+ // encoding: xxxz:1101 xz11:0000 xz00:0000
+ QTest::newRow("lo-surrogate") << QByteArray("\xED\xB0\x80");
+
+ // not even in pair:
+ QTest::newRow("surrogate-pair") << QByteArray("\xED\xA0\x80\xED\xB0\x80");
+
+ // Characters outside the Unicode range:
+ // 0x110000: 00 0100 01 0000 00 0000 00 0000
+ // encoding: xxxx:z100 xz01:0000 xz00:0000 xz00:0000
+ QTest::newRow("non-unicode-1") << QByteArray("\xF4\x90\x80\x80");
+ // 0x200000: 00 1000 00 0000 00 0000 00 0000
+ // encoding: xxxx:xz00 xz00:1000 xz00:0000 xz00:0000 xz00:0000
+ QTest::newRow("non-unicode-2") << QByteArray("\xF8\x88\x80\x80\x80");
+ // 0x04000000: 0100 00 0000 00 0000 00 0000 00 0000
+ // encoding: xxxx:xxz0 xz00:0100 xz00:0000 xz00:0000 xz00:0001 xz00:0001
+ QTest::newRow("non-unicode-3") << QByteArray("\xFC\x84\x80\x80\x80\x80");
+ // 0x7fffffff: 1 11 1111 11 1111 11 1111 11 1111 11 1111
+ // encoding: xxxx:xxz0 xz00:0100 xz00:0000 xz00:0000 xz00:0001 xz00:0001
+ QTest::newRow("non-unicode-3") << QByteArray("\xFD\xBF\xBF\xBF\xBF\xBF");
+
+ // As seen above, 0xFE and 0xFF never appear:
+ QTest::newRow("fe") << QByteArray("\xFE");
+ QTest::newRow("fe-bis") << QByteArray("\xFE\xBF\xBF\xBF\xBF\xBF\xBF");
+ QTest::newRow("ff") << QByteArray("\xFF");
+ QTest::newRow("ff-bis") << QByteArray("\xFF\xBF\xBF\xBF\xBF\xBF\xBF\xBF");
+
+ // some combinations in UTF-8 are invalid even though they have the proper bits set
+ // these are known as overlong sequences
+
+ // "A": U+0041: 01 00 0001
+ // overlong 2: xxz0:0001 xz00:0001
+ QTest::newRow("overlong-1-2") << QByteArray("\xC1\x81");
+ // overlong 3: xxxz:0000 xz00:0001 xz00:0001
+ QTest::newRow("overlong-1-3") << QByteArray("\xE0\x81\x81");
+ // overlong 4: xxxx:z000 xz00:0000 xz00:0001 xz00:0001
+ QTest::newRow("overlong-1-4") << QByteArray("\xF0\x80\x81\x81");
+ // overlong 5: xxxx:xz00 xz00:0000 xz00:0000 xz00:0001 xz00:0001
+ QTest::newRow("overlong-1-5") << QByteArray("\xF8\x80\x80\x81\x81");
+ // overlong 6: xxxx:xxz0 xz00:0000 xz00:0000 xz00:0000 xz00:0001 xz00:0001
+ QTest::newRow("overlong-1-6") << QByteArray("\xFC\x80\x80\x80\x81\x81");
+
+ // NBSP: U+00A0: 10 00 0000
+ // proper encoding: xxz0:0010 xz00:0000
+ // overlong 3: xxxz:0000 xz00:0010 xz00:0000
+ QTest::newRow("overlong-2-3") << QByteArray("\xC0\x82\x80");
+ // overlong 4: xxxx:z000 xz00:0000 xz00:0010 xz00:0000
+ QTest::newRow("overlong-2-4") << QByteArray("\xF0\x80\x82\x80");
+ // overlong 5: xxxx:xz00 xz00:0000 xz00:0000 xz00:0010 xz00:0000
+ QTest::newRow("overlong-2-4") << QByteArray("\xF8\x80\x80\x82\x80");
+ // overlong 6: xxxx:xxz0 xz00:0000 xz00:0000 xz00:0000 xz00:0010 xz00:0000
+ QTest::newRow("overlong-2-4") << QByteArray("\xFC\x80\x80\x80\x82\x80");
+
+ // U+0800: 10 0000 00 0000
+ // proper encoding: xxxz:0000 xz10:0000 xz00:0000
+ // overlong 4: xxxx:z000 xz00:0000 xz10:0000 xz00:0000
+ QTest::newRow("overlong-3-4") << QByteArray("\xF0\x80\xA0\x80");
+ // overlong 5: xxxx:xz00 xz00:0000 xz00:0000 xz10:0000 xz00:0000
+ QTest::newRow("overlong-3-5") << QByteArray("\xF8\x80\x80\xA0\x80");
+ // overlong 6: xxxx:xxz0 xz00:0000 xz00:0000 xz00:0000 xz10:0000 xz00:0000
+ QTest::newRow("overlong-3-6") << QByteArray("\xFC\x80\x80\x80\xA0\x80");
+
+ // U+010000: 00 0100 00 0000 00 0000
+ // proper encoding: xxxx:z000 xz00:0100 xz00:0000 xz00:0000
+ // overlong 5: xxxx:xz00 xz00:0000 xz00:0100 xz00:0000 xz00:0000
+ QTest::newRow("overlong-4-5") << QByteArray("\xF8\x80\x84\x80\x80");
+ // overlong 6: xxxx:xxz0 xz00:0000 xz00:0000 xz00:0100 xz00:0000 xz00:0000
+ QTest::newRow("overlong-4-6") << QByteArray("\xFC\x80\x80\x84\x80\x80");
+}
+
+void tst_Utf8::invalidUtf8()
+{
+ QFETCH(QByteArray, utf8);
+
+ QSharedPointer<QTextDecoder> decoder = QSharedPointer<QTextDecoder>(codec->makeDecoder());
+ QString decoded = decoder->toUnicode(utf8);
+ QVERIFY(decoder->hasFailure());
+}
+
+QTEST_MAIN(tst_Utf8)
+#include "tst_utf8.moc"
diff --git a/tests/auto/utf8/utf8.pro b/tests/auto/utf8/utf8.pro
new file mode 100644
index 0000000..4ec6851
--- /dev/null
+++ b/tests/auto/utf8/utf8.pro
@@ -0,0 +1,3 @@
+load(qttest_p4)
+QT -= gui
+SOURCES += tst_utf8.cpp