diff options
Diffstat (limited to 'tests/auto')
9 files changed, 19 insertions, 19 deletions
diff --git a/tests/auto/corelib/io/largefile/tst_largefile.cpp b/tests/auto/corelib/io/largefile/tst_largefile.cpp index 99e1d5a32f..5975303ca6 100644 --- a/tests/auto/corelib/io/largefile/tst_largefile.cpp +++ b/tests/auto/corelib/io/largefile/tst_largefile.cpp @@ -228,7 +228,7 @@ QByteArray const &tst_LargeFile::getDataBlock(int index, qint64 position) void tst_LargeFile::initTestCase() { m_previousCurrent = QDir::currentPath(); - m_tempDir = QSharedPointer<QTemporaryDir>(new QTemporaryDir); + m_tempDir = QSharedPointer<QTemporaryDir>::create(); QVERIFY2(!m_tempDir.isNull(), qPrintable("Could not create temporary directory.")); QVERIFY2(QDir::setCurrent(m_tempDir->path()), qPrintable("Could not switch current directory")); diff --git a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp index dba920d1f7..ddfd14550b 100644 --- a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp +++ b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp @@ -466,7 +466,7 @@ protected: if (create) { QSharedPointer<File> &p = fileSystem[fileName_]; if (p.isNull()) - p = QSharedPointer<File>(new File); + p = QSharedPointer<File>::create(); return p; } @@ -564,7 +564,7 @@ class FileEngineHandler void tst_QAbstractFileEngine::initTestCase() { m_previousCurrent = QDir::currentPath(); - m_currentDir = QSharedPointer<QTemporaryDir>(new QTemporaryDir()); + m_currentDir = QSharedPointer<QTemporaryDir>::create(); QVERIFY2(!m_currentDir.isNull(), qPrintable("Could not create current directory.")); QDir::setCurrent(m_currentDir->path()); } diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp index 0068411b94..14a2528cc6 100644 --- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp @@ -300,7 +300,7 @@ void tst_QDataStream::getSetCheck() void tst_QDataStream::initTestCase() { m_previousCurrent = QDir::currentPath(); - m_tempDir = QSharedPointer<QTemporaryDir>(new QTemporaryDir); + m_tempDir = QSharedPointer<QTemporaryDir>::create(); QVERIFY2(!m_tempDir.isNull(), qPrintable("Could not create temporary directory.")); QVERIFY2(QDir::setCurrent(m_tempDir->path()), qPrintable("Could not switch current directory")); } diff --git a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp index 5cb532f76b..a76fd4703e 100644 --- a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp +++ b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp @@ -71,7 +71,7 @@ void tst_QIODevice::initTestCase() || QFile::copy(QStringLiteral(":/tst_qiodevice.cpp"), QStringLiteral("./tst_qiodevice.cpp"))); #endif m_previousCurrent = QDir::currentPath(); - m_tempDir = QSharedPointer<QTemporaryDir>(new QTemporaryDir); + m_tempDir = QSharedPointer<QTemporaryDir>::create(); QVERIFY2(!m_tempDir.isNull(), qPrintable("Could not create temporary directory.")); QVERIFY2(QDir::setCurrent(m_tempDir->path()), qPrintable("Could not switch current directory")); } diff --git a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp index 9e257267ca..11896d2f15 100644 --- a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp +++ b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp @@ -56,7 +56,7 @@ class tst_QDBusAbstractInterface: public QObject return Pinger(); if (service.isEmpty() && !service.isNull()) service = con.baseService(); - return Pinger(new org::qtproject::QtDBus::Pinger(service, path, con)); + return Pinger::create(service, path, con); } Pinger getPingerPeer(const QString &path = "/", const QString &service = "") @@ -64,7 +64,7 @@ class tst_QDBusAbstractInterface: public QObject QDBusConnection con = QDBusConnection("peer"); if (!con.isConnected()) return Pinger(); - return Pinger(new org::qtproject::QtDBus::Pinger(service, path, con)); + return Pinger::create(service, path, con); } void resetServer() diff --git a/tests/auto/network/access/qftp/tst_qftp.cpp b/tests/auto/network/access/qftp/tst_qftp.cpp index a1c8399a26..3711ce431c 100644 --- a/tests/auto/network/access/qftp/tst_qftp.cpp +++ b/tests/auto/network/access/qftp/tst_qftp.cpp @@ -205,7 +205,7 @@ void tst_QFtp::initTestCase() QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); #ifndef QT_NO_BEARERMANAGEMENT QNetworkConfigurationManager manager; - networkSessionImplicit = QSharedPointer<QNetworkSession>(new QNetworkSession(manager.defaultConfiguration())); + networkSessionImplicit = QSharedPointer<QNetworkSession>::create(manager.defaultConfiguration()); networkSessionImplicit->open(); QVERIFY(networkSessionImplicit->waitForOpened(60000)); //there may be user prompt on 1st connect #endif diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index 43d0781083..af7cf24838 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -213,7 +213,7 @@ void tst_QUdpSocket::initTestCase_data() #ifndef QT_NO_BEARERMANAGEMENT netConfMan = new QNetworkConfigurationManager(this); networkConfiguration = netConfMan->defaultConfiguration(); - networkSession = QSharedPointer<QNetworkSession>(new QNetworkSession(networkConfiguration)); + networkSession = QSharedPointer<QNetworkSession>::create(networkConfiguration); if (!networkSession->isOpen()) { networkSession->open(); QVERIFY(networkSession->waitForOpened(30000)); diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp index c75c1dc87e..a27e0b6048 100644 --- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp +++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp @@ -3442,7 +3442,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_Right << Qt::Key_Down; - model.reset(new QStandardItemModel(4, 2)); + model = QSharedPointer<QStandardItemModel>::create(4, 2); QTest::newRow("row span, top down") << keyPresses << model << 1 << 1 << 2 << 1 << model->index(1, 1) << model->index(1, 1); @@ -3455,7 +3455,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_End << Qt::Key_Down << Qt::Key_Left; - model.reset(new QStandardItemModel(3, 3)); + model = QSharedPointer<QStandardItemModel>::create(3, 3); QTest::newRow("row span, right to left") << keyPresses << model << 1 << 1 << 2 << 1 << model->index(1, 1) << model->index(1, 1); @@ -3468,7 +3468,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_PageDown << Qt::Key_Right; - model.reset(new QStandardItemModel(3, 3)); + model = QSharedPointer<QStandardItemModel>::create(3, 3); QTest::newRow("row span, left to right") << keyPresses << model << 1 << 1 << 2 << 1 << model->index(2, 1) << model->index(1, 1); @@ -3481,7 +3481,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_PageDown << Qt::Key_Up; - model.reset(new QStandardItemModel(3, 3)); + model = QSharedPointer<QStandardItemModel>::create(3, 3); QTest::newRow("col span, bottom up") << keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 0) << model->index(1, 0); @@ -3494,7 +3494,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_PageDown << Qt::Key_Right << Qt::Key_Up; - model.reset(new QStandardItemModel(3, 3)); + model = QSharedPointer<QStandardItemModel>::create(3, 3); QTest::newRow("col span, bottom up #2") << keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 1) << model->index(1, 0); @@ -3507,7 +3507,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_End << Qt::Key_Down; - model.reset(new QStandardItemModel(3, 3)); + model = QSharedPointer<QStandardItemModel>::create(3, 3); QTest::newRow("col span, top down") << keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 2) << model->index(1, 0); } diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index bd5d5fac79..918df275e9 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -5753,14 +5753,14 @@ void tst_QWidget::testWindowIconChangeEventPropagation() QList <EventSpyPtr> applicationEventSpies; QList <EventSpyPtr> widgetEventSpies; foreach (QWidget *widget, widgets) { - applicationEventSpies.append(EventSpyPtr(new EventSpy<QWidget>(widget, QEvent::ApplicationWindowIconChange))); - widgetEventSpies.append(EventSpyPtr(new EventSpy<QWidget>(widget, QEvent::WindowIconChange))); + applicationEventSpies.append(EventSpyPtr::create(widget, QEvent::ApplicationWindowIconChange)); + widgetEventSpies.append(EventSpyPtr::create(widget, QEvent::WindowIconChange)); } QList <WindowEventSpyPtr> appWindowEventSpies; QList <WindowEventSpyPtr> windowEventSpies; foreach (QWindow *window, windows) { - appWindowEventSpies.append(WindowEventSpyPtr(new EventSpy<QWindow>(window, QEvent::ApplicationWindowIconChange))); - windowEventSpies.append(WindowEventSpyPtr(new EventSpy<QWindow>(window, QEvent::WindowIconChange))); + appWindowEventSpies.append(WindowEventSpyPtr::create(window, QEvent::ApplicationWindowIconChange)); + windowEventSpies.append(WindowEventSpyPtr::create(window, QEvent::WindowIconChange)); } // QApplication::setWindowIcon |