diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-11-12 00:42:22 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-11-12 00:42:22 (GMT) |
commit | 4e3f88c8b1d74b720bf3e17f9bdedf84a9748b3d (patch) | |
tree | c23b51ac0a1a244a0f18d287f0feebb20268eefb /tests | |
parent | 49cc2d35d7da4a78d696503930720e88a6403722 (diff) | |
parent | a4053a6e7a9a686433dc4814a5b52da3bc96969f (diff) | |
download | Qt-4e3f88c8b1d74b720bf3e17f9bdedf84a9748b3d.zip Qt-4e3f88c8b1d74b720bf3e17f9bdedf84a9748b3d.tar.gz Qt-4e3f88c8b1d74b720bf3e17f9bdedf84a9748b3d.tar.bz2 |
Merge branch '4.6' of git://scm.dev.nokia.troll.no/qt/qt into kinetic-declarativeui
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qcombobox/tst_qcombobox.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qdatastream/qdatastream.pro | 2 | ||||
-rw-r--r-- | tests/auto/qdatastream/tst_qdatastream.cpp | 3 | ||||
-rw-r--r-- | tests/auto/qfile/largefile/largefile.pro | 2 | ||||
-rw-r--r-- | tests/auto/qfile/largefile/tst_largefile.cpp | 11 | ||||
-rw-r--r-- | tests/auto/qfile/test/test.pro | 1 | ||||
-rw-r--r-- | tests/auto/qlistwidget/tst_qlistwidget.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qscopedpointer/tst_qscopedpointer.cpp | 3 | ||||
-rw-r--r-- | tests/manual/windowflags/previewwindow.cpp | 20 | ||||
-rw-r--r-- | tests/manual/windowflags/previewwindow.h | 6 |
10 files changed, 43 insertions, 11 deletions
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp index 18ebddc..cc59b62 100644 --- a/tests/auto/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/qcombobox/tst_qcombobox.cpp @@ -2517,8 +2517,8 @@ void tst_QComboBox::task_QTBUG_1071_changingFocusEmitsActivated() cb.addItem("1"); cb.addItem("2"); QLineEdit edit; - layout.add(&cb); - layout.add(&edit); + layout.addWidget(&cb); + layout.addWidget(&edit); w.show(); QTest::qWaitForWindowShown(&w); diff --git a/tests/auto/qdatastream/qdatastream.pro b/tests/auto/qdatastream/qdatastream.pro index 5b90357..c132073 100644 --- a/tests/auto/qdatastream/qdatastream.pro +++ b/tests/auto/qdatastream/qdatastream.pro @@ -12,7 +12,7 @@ QT += svg wince*: { - addFiles.sources = datastream.q42 gearflowers.svg + addFiles.sources = datastream.q42 tests2.svg addFiles.path = . DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\"\\\" diff --git a/tests/auto/qdatastream/tst_qdatastream.cpp b/tests/auto/qdatastream/tst_qdatastream.cpp index 7535645..24447ea 100644 --- a/tests/auto/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/qdatastream/tst_qdatastream.cpp @@ -320,8 +320,7 @@ void tst_QDataStream::getSetCheck() tst_QDataStream::tst_QDataStream() { - svgFile = QLatin1String(SRCDIR) + QLatin1String("/") + - QLatin1String(SVGFILE); + svgFile = QLatin1String(SRCDIR SVGFILE); } tst_QDataStream::~tst_QDataStream() diff --git a/tests/auto/qfile/largefile/largefile.pro b/tests/auto/qfile/largefile/largefile.pro index 0f96865..d67cb46 100644 --- a/tests/auto/qfile/largefile/largefile.pro +++ b/tests/auto/qfile/largefile/largefile.pro @@ -2,3 +2,5 @@ load(qttest_p4) QT = core SOURCES += tst_largefile.cpp + +wince*: SOURCES += $$QT_SOURCE_TREE/src/corelib/kernel/qfunctions_wince.cpp diff --git a/tests/auto/qfile/largefile/tst_largefile.cpp b/tests/auto/qfile/largefile/tst_largefile.cpp index 9105063..980f4ba 100644 --- a/tests/auto/qfile/largefile/tst_largefile.cpp +++ b/tests/auto/qfile/largefile/tst_largefile.cpp @@ -54,7 +54,10 @@ #ifdef Q_OS_WIN #include <windows.h> + +#ifndef Q_OS_WINCE #include <io.h> +#endif #ifndef FSCTL_SET_SPARSE // MinGW doesn't define this. @@ -295,7 +298,7 @@ void tst_LargeFile::sparseFileData() void tst_LargeFile::createSparseFile() { -#if defined(Q_OS_WIN) +#if defined(Q_OS_WIN32) // On Windows platforms, we must explicitly set the file to be sparse, // so disk space is not allocated for the full file when writing to it. HANDLE handle = ::CreateFileA("qt_largefile.tmp", @@ -313,7 +316,7 @@ void tst_LargeFile::createSparseFile() int fd = ::_open_osfhandle((intptr_t)handle, 0); QVERIFY( -1 != fd ); QVERIFY( largeFile.open(fd, QIODevice::WriteOnly | QIODevice::Unbuffered) ); -#else // !Q_OS_WIN +#else // !Q_OS_WIN32 largeFile.setFileName("qt_largefile.tmp"); QVERIFY( largeFile.open(QIODevice::WriteOnly | QIODevice::Unbuffered) ); #endif @@ -321,13 +324,13 @@ void tst_LargeFile::createSparseFile() void tst_LargeFile::closeSparseFile() { -#if defined(Q_OS_WIN) +#if defined(Q_OS_WIN32) int fd = largeFile.handle(); #endif largeFile.close(); -#if defined(Q_OS_WIN) +#if defined(Q_OS_WIN32) if (-1 != fd) ::_close(fd); #endif diff --git a/tests/auto/qfile/test/test.pro b/tests/auto/qfile/test/test.pro index 46f63b3..faaa927 100644 --- a/tests/auto/qfile/test/test.pro +++ b/tests/auto/qfile/test/test.pro @@ -14,6 +14,7 @@ wince*|symbian { } wince* { + SOURCES += $$QT_SOURCE_TREE/src/corelib/kernel/qfunctions_wince.cpp # needed for QT_OPEN DEFINES += SRCDIR=\\\"\\\" } else:symbian { # do not define SRCDIR at all diff --git a/tests/auto/qlistwidget/tst_qlistwidget.cpp b/tests/auto/qlistwidget/tst_qlistwidget.cpp index 5c6ed54..cb8f1e9 100644 --- a/tests/auto/qlistwidget/tst_qlistwidget.cpp +++ b/tests/auto/qlistwidget/tst_qlistwidget.cpp @@ -879,7 +879,7 @@ void tst_QListWidget::moveItemsPriv() for (int r = 0; r < rowCount; ++r) new QListWidgetItem(QString::number(r), testWidget); - QListModel *model = dynamic_cast<QListModel *>(testWidget->model()); + QListModel *model = qobject_cast<QListModel *>(testWidget->model()); QVERIFY(model); QSignalSpy beginMoveSpy(model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int))); QSignalSpy movedSpy(model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int))); diff --git a/tests/auto/qscopedpointer/tst_qscopedpointer.cpp b/tests/auto/qscopedpointer/tst_qscopedpointer.cpp index ddd5579..b99760e 100644 --- a/tests/auto/qscopedpointer/tst_qscopedpointer.cpp +++ b/tests/auto/qscopedpointer/tst_qscopedpointer.cpp @@ -321,7 +321,7 @@ struct RefCounted instanceCount.ref(); } - RefCounted(RefCounted const &other) + RefCounted(RefCounted const &) : ref(0) { instanceCount.ref(); @@ -335,6 +335,7 @@ struct RefCounted RefCounted &operator=(RefCounted const &) { + return *this; } QAtomicInt ref; diff --git a/tests/manual/windowflags/previewwindow.cpp b/tests/manual/windowflags/previewwindow.cpp index 78f9fcb..31e8b3e 100644 --- a/tests/manual/windowflags/previewwindow.cpp +++ b/tests/manual/windowflags/previewwindow.cpp @@ -103,8 +103,18 @@ PreviewWindow::PreviewWindow(QWidget *parent) closeButton = new QPushButton(tr("&Close")); connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); + showNormalButton = new QPushButton(tr("Show normal")); + connect(showNormalButton, SIGNAL(clicked()), this, SLOT(showNormal())); + showMaximizedButton = new QPushButton(tr("Show maximized")); + connect(showMaximizedButton, SIGNAL(clicked()), this, SLOT(showMaximized())); + showFullScreenButton = new QPushButton(tr("Show fullscreen")); + connect(showFullScreenButton, SIGNAL(clicked()), this, SLOT(showFullScreen())); + QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(textEdit); + layout->addWidget(showNormalButton); + layout->addWidget(showMaximizedButton); + layout->addWidget(showFullScreenButton); layout->addWidget(closeButton); setLayout(layout); @@ -129,8 +139,18 @@ PreviewDialog::PreviewDialog(QWidget *parent) closeButton = new QPushButton(tr("&Close")); connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); + showNormalButton = new QPushButton(tr("Show normal")); + connect(showNormalButton, SIGNAL(clicked()), this, SLOT(showNormal())); + showMaximizedButton = new QPushButton(tr("Show maximized")); + connect(showMaximizedButton, SIGNAL(clicked()), this, SLOT(showMaximized())); + showFullScreenButton = new QPushButton(tr("Show fullscreen")); + connect(showFullScreenButton, SIGNAL(clicked()), this, SLOT(showFullScreen())); + QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(textEdit); + layout->addWidget(showNormalButton); + layout->addWidget(showMaximizedButton); + layout->addWidget(showFullScreenButton); layout->addWidget(closeButton); setLayout(layout); diff --git a/tests/manual/windowflags/previewwindow.h b/tests/manual/windowflags/previewwindow.h index fdd21d7..fbf822b 100644 --- a/tests/manual/windowflags/previewwindow.h +++ b/tests/manual/windowflags/previewwindow.h @@ -62,6 +62,9 @@ public: private: QTextEdit *textEdit; QPushButton *closeButton; + QPushButton *showNormalButton; + QPushButton *showMaximizedButton; + QPushButton *showFullScreenButton; }; class PreviewDialog : public QDialog @@ -76,6 +79,9 @@ public: private: QTextEdit *textEdit; QPushButton *closeButton; + QPushButton *showNormalButton; + QPushButton *showMaximizedButton; + QPushButton *showFullScreenButton; }; #endif |