diff options
author | Thomas Zander <t.zander@nokia.com> | 2010-10-06 14:32:43 +0200 |
---|---|---|
committer | Thomas Zander <t.zander@nokia.com> | 2010-10-06 14:32:43 +0200 |
commit | e3724aeab93a2ab3cc5b1d78c42f9a4e2f60628d (patch) | |
tree | 08fa39a9605ec38a45247baea0e2053179f5970f /tests/benchmarks | |
parent | 838ed9c68aef4d5a4f0b4d4dbbc1c1f7797cde91 (diff) | |
parent | 901ea45ca02dc8fbbf3f6112240c4e468c240b73 (diff) | |
download | qt4-tools-e3724aeab93a2ab3cc5b1d78c42f9a4e2f60628d.tar.gz |
Merge commit 'origin/master' into fileEngines
Conflicts:
src/s60installs/bwins/QtCoreu.def
Diffstat (limited to 'tests/benchmarks')
39 files changed, 188 insertions, 50 deletions
diff --git a/tests/benchmarks/declarative/compilation/data/BoomBlock.qml b/tests/benchmarks/declarative/compilation/data/BoomBlock.qml index 3f4357915a..b757900579 100644 --- a/tests/benchmarks/declarative/compilation/data/BoomBlock.qml +++ b/tests/benchmarks/declarative/compilation/data/BoomBlock.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.particles 1.0 Item { diff --git a/tests/benchmarks/declarative/creation/data/item.qml b/tests/benchmarks/declarative/creation/data/item.qml index f1a7dbc9ba..a6223d0a57 100644 --- a/tests/benchmarks/declarative/creation/data/item.qml +++ b/tests/benchmarks/declarative/creation/data/item.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 Item { Item {} diff --git a/tests/benchmarks/declarative/creation/data/qobject.qml b/tests/benchmarks/declarative/creation/data/qobject.qml index bc6b152768..33aeb5761a 100644 --- a/tests/benchmarks/declarative/creation/data/qobject.qml +++ b/tests/benchmarks/declarative/creation/data/qobject.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 QtObject { } diff --git a/tests/benchmarks/declarative/creation/tst_creation.cpp b/tests/benchmarks/declarative/creation/tst_creation.cpp index 94a67fd455..6bf7943b65 100644 --- a/tests/benchmarks/declarative/creation/tst_creation.cpp +++ b/tests/benchmarks/declarative/creation/tst_creation.cpp @@ -130,7 +130,7 @@ void tst_creation::qobject_cpp() void tst_creation::qobject_qml() { QDeclarativeComponent component(&engine); - component.setData("import Qt 4.7\nQtObject {}", QUrl()); + component.setData("import QtQuick 1.0\nQtObject {}", QUrl()); QObject *obj = component.create(); delete obj; diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/data/object.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/object.qml index df0d5b245a..e484ef7607 100644 --- a/tests/benchmarks/declarative/qdeclarativecomponent/data/object.qml +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/object.qml @@ -39,6 +39,6 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 QtObject {} diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/data/object_id.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/object_id.qml index 399aa78e88..3ce3296db8 100644 --- a/tests/benchmarks/declarative/qdeclarativecomponent/data/object_id.qml +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/object_id.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 QtObject { id: blah diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml index 4b1d81c9c9..073ed902a9 100644 --- a/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.particles 1.0 Item { id:block diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.2.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.2.qml index 5d67d251fe..6cf304c1f8 100644 --- a/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.2.qml +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.2.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 QtObject { property int a diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.qml index a22ba254c0..c4fc05c8fc 100644 --- a/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.qml +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 QtObject { property int a diff --git a/tests/benchmarks/declarative/qdeclarativemetaproperty/data/object.qml b/tests/benchmarks/declarative/qdeclarativemetaproperty/data/object.qml index 8c2f46ba3b..90145e80f3 100644 --- a/tests/benchmarks/declarative/qdeclarativemetaproperty/data/object.qml +++ b/tests/benchmarks/declarative/qdeclarativemetaproperty/data/object.qml @@ -39,6 +39,6 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 Item {} diff --git a/tests/benchmarks/declarative/qdeclarativemetaproperty/data/synthesized_object.qml b/tests/benchmarks/declarative/qdeclarativemetaproperty/data/synthesized_object.qml index 45748f5369..29dfbe5bd9 100644 --- a/tests/benchmarks/declarative/qdeclarativemetaproperty/data/synthesized_object.qml +++ b/tests/benchmarks/declarative/qdeclarativemetaproperty/data/synthesized_object.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 Item { property int blah diff --git a/tests/benchmarks/declarative/qmltime/example.qml b/tests/benchmarks/declarative/qmltime/example.qml index dca1429290..4b6de1d88f 100644 --- a/tests/benchmarks/declarative/qmltime/example.qml +++ b/tests/benchmarks/declarative/qmltime/example.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/anchors/empty.qml b/tests/benchmarks/declarative/qmltime/tests/anchors/empty.qml index 6d8be033fa..f9418f88ae 100644 --- a/tests/benchmarks/declarative/qmltime/tests/anchors/empty.qml +++ b/tests/benchmarks/declarative/qmltime/tests/anchors/empty.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/anchors/fill.qml b/tests/benchmarks/declarative/qmltime/tests/anchors/fill.qml index 5371c3d2c7..ef6839faa0 100644 --- a/tests/benchmarks/declarative/qmltime/tests/anchors/fill.qml +++ b/tests/benchmarks/declarative/qmltime/tests/anchors/fill.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/anchors/null.qml b/tests/benchmarks/declarative/qmltime/tests/anchors/null.qml index bb43dc6bb6..b71900171d 100644 --- a/tests/benchmarks/declarative/qmltime/tests/anchors/null.qml +++ b/tests/benchmarks/declarative/qmltime/tests/anchors/null.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/animation/large.qml b/tests/benchmarks/declarative/qmltime/tests/animation/large.qml index 11bb6ba56f..d109313f27 100644 --- a/tests/benchmarks/declarative/qmltime/tests/animation/large.qml +++ b/tests/benchmarks/declarative/qmltime/tests/animation/large.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/animation/largeNoProps.qml b/tests/benchmarks/declarative/qmltime/tests/animation/largeNoProps.qml index d40627f855..6c055dc51a 100644 --- a/tests/benchmarks/declarative/qmltime/tests/animation/largeNoProps.qml +++ b/tests/benchmarks/declarative/qmltime/tests/animation/largeNoProps.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml b/tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml index 049920106e..eed5339255 100644 --- a/tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml +++ b/tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml b/tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml index 9064bc2483..cc27f0455a 100644 --- a/tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml +++ b/tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/no_creation.qml b/tests/benchmarks/declarative/qmltime/tests/item_creation/no_creation.qml index d27b2b617d..7f8909dd4b 100644 --- a/tests/benchmarks/declarative/qmltime/tests/item_creation/no_creation.qml +++ b/tests/benchmarks/declarative/qmltime/tests/item_creation/no_creation.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml b/tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml index 0867d0b418..05e287b88d 100644 --- a/tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml +++ b/tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/loader/Loaded.qml b/tests/benchmarks/declarative/qmltime/tests/loader/Loaded.qml index 416e0ea183..7199a50d24 100644 --- a/tests/benchmarks/declarative/qmltime/tests/loader/Loaded.qml +++ b/tests/benchmarks/declarative/qmltime/tests/loader/Loaded.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 Item { Rectangle {} diff --git a/tests/benchmarks/declarative/qmltime/tests/loader/component_loader.qml b/tests/benchmarks/declarative/qmltime/tests/loader/component_loader.qml index f610eb0dac..a668423dfc 100644 --- a/tests/benchmarks/declarative/qmltime/tests/loader/component_loader.qml +++ b/tests/benchmarks/declarative/qmltime/tests/loader/component_loader.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/loader/empty_loader.qml b/tests/benchmarks/declarative/qmltime/tests/loader/empty_loader.qml index 334e1b45d4..7070d91e2f 100644 --- a/tests/benchmarks/declarative/qmltime/tests/loader/empty_loader.qml +++ b/tests/benchmarks/declarative/qmltime/tests/loader/empty_loader.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/loader/no_loader.qml b/tests/benchmarks/declarative/qmltime/tests/loader/no_loader.qml index 507ed34a1e..7bf14defdc 100644 --- a/tests/benchmarks/declarative/qmltime/tests/loader/no_loader.qml +++ b/tests/benchmarks/declarative/qmltime/tests/loader/no_loader.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/loader/source_loader.qml b/tests/benchmarks/declarative/qmltime/tests/loader/source_loader.qml index 1092a9fdbd..2b95d603d4 100644 --- a/tests/benchmarks/declarative/qmltime/tests/loader/source_loader.qml +++ b/tests/benchmarks/declarative/qmltime/tests/loader/source_loader.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml index a125c5498b..417ec94b73 100644 --- a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml +++ b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml index 18c8fb4819..3e9a076591 100644 --- a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml +++ b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml index 2668c4c189..d87aa32b6d 100644 --- a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml +++ b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/vmemetaobject/null.qml b/tests/benchmarks/declarative/qmltime/tests/vmemetaobject/null.qml index 424f768a4f..dc2fcb4849 100644 --- a/tests/benchmarks/declarative/qmltime/tests/vmemetaobject/null.qml +++ b/tests/benchmarks/declarative/qmltime/tests/vmemetaobject/null.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/vmemetaobject/property.qml b/tests/benchmarks/declarative/qmltime/tests/vmemetaobject/property.qml index f803b82747..3adefbc0fd 100644 --- a/tests/benchmarks/declarative/qmltime/tests/vmemetaobject/property.qml +++ b/tests/benchmarks/declarative/qmltime/tests/vmemetaobject/property.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/script/data/CustomObject.qml b/tests/benchmarks/declarative/script/data/CustomObject.qml index 1656453fbd..97f6d39cb0 100644 --- a/tests/benchmarks/declarative/script/data/CustomObject.qml +++ b/tests/benchmarks/declarative/script/data/CustomObject.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 QtObject { property real prop1: 0 diff --git a/tests/benchmarks/declarative/script/data/block.qml b/tests/benchmarks/declarative/script/data/block.qml index f7b2ab3163..4575050abd 100644 --- a/tests/benchmarks/declarative/script/data/block.qml +++ b/tests/benchmarks/declarative/script/data/block.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 Rectangle { width: 200; height: 200 diff --git a/tests/benchmarks/declarative/script/data/global_prop.qml b/tests/benchmarks/declarative/script/data/global_prop.qml index 4fb7ee72a5..29bbb7d03d 100644 --- a/tests/benchmarks/declarative/script/data/global_prop.qml +++ b/tests/benchmarks/declarative/script/data/global_prop.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import "global.js" as Program Rectangle { diff --git a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp index 0098d8ef22..6b94f3cebc 100644 --- a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -51,8 +51,7 @@ #include "../../../../auto/network-settings.h" -typedef QSharedPointer<QVarLengthArray<char, 0> > QVarLengthArraySharedPointer; -Q_DECLARE_METATYPE(QVarLengthArraySharedPointer) +Q_DECLARE_METATYPE(QSharedPointer<char>) class TimedSender: public QThread { @@ -655,44 +654,63 @@ void tst_qnetworkreply::httpDownloadPerformance() << ((UploadSize/1024.0)/(elapsed/1000.0)) << " kB/sec"; }; +enum HttpDownloadPerformanceDownloadBufferTestType { + JustDownloadBuffer, + DownloadBufferButUseRead, + NoDownloadBuffer +}; +Q_DECLARE_METATYPE(HttpDownloadPerformanceDownloadBufferTestType) + class HttpDownloadPerformanceClientDownloadBuffer : QObject { Q_OBJECT private: - bool useDownloadBuffer; + HttpDownloadPerformanceDownloadBufferTestType testType; QNetworkReply *reply; qint64 uploadSize; + QList<qint64> bytesAvailableList; public: - HttpDownloadPerformanceClientDownloadBuffer (QNetworkReply *reply, bool useDownloadBuffer, qint64 uploadSize) - : useDownloadBuffer(useDownloadBuffer), reply(reply), uploadSize(uploadSize) + HttpDownloadPerformanceClientDownloadBuffer (QNetworkReply *reply, HttpDownloadPerformanceDownloadBufferTestType testType, qint64 uploadSize) + : testType(testType), reply(reply), uploadSize(uploadSize) { connect(reply, SIGNAL(finished()), this, SLOT(finishedSlot())); } public slots: void finishedSlot() { - if (useDownloadBuffer) { + if (testType == JustDownloadBuffer) { + // We have a download buffer and use it. This should be the fastest benchmark result. QVariant downloadBufferAttribute = reply->attribute(QNetworkRequest::DownloadBufferAttribute); - QSharedPointer<QVarLengthArray<char, 0> > data = downloadBufferAttribute.value<QSharedPointer<QVarLengthArray<char, 0> > >(); - } else { + QSharedPointer<char> data = downloadBufferAttribute.value<QSharedPointer<char> >(); + } else if (testType == DownloadBufferButUseRead) { + // We had a download buffer but we benchmark here the "legacy" read() way to access it + char* replyData = (char*) qMalloc(uploadSize); + QVERIFY(reply->read(replyData, uploadSize) == uploadSize); + qFree(replyData); + } else if (testType == NoDownloadBuffer) { // We did not have a download buffer but we still need to benchmark having the data, e.g. reading it all. + // This should be the slowest benchmark result. char* replyData = (char*) qMalloc(uploadSize); QVERIFY(reply->read(replyData, uploadSize) == uploadSize); qFree(replyData); } + + QMetaObject::invokeMethod(&QTestEventLoop::instance(), "exitLoop", Qt::QueuedConnection); } }; void tst_qnetworkreply::httpDownloadPerformanceDownloadBuffer_data() { - QTest::addColumn<bool>("useDownloadBuffer"); + QTest::addColumn<HttpDownloadPerformanceDownloadBufferTestType>("testType"); - QTest::newRow("use-download-buffer") << true; - QTest::newRow("do-not-use-download-buffer") << false; + QTest::newRow("use-download-buffer") << JustDownloadBuffer; + QTest::newRow("use-download-buffer-but-use-read") << DownloadBufferButUseRead; + QTest::newRow("do-not-use-download-buffer") << NoDownloadBuffer; } +// Please note that the whole "zero copy" download buffer API is private right now. Do not use it. void tst_qnetworkreply::httpDownloadPerformanceDownloadBuffer() { - QFETCH(bool, useDownloadBuffer); + QFETCH(HttpDownloadPerformanceDownloadBufferTestType, testType); // On my Linux Desktop the results are already visible with 128 kB, however we use this to have good results. #if defined(Q_OS_SYMBIAN) || defined(Q_WS_WINCE_WM) @@ -705,18 +723,18 @@ void tst_qnetworkreply::httpDownloadPerformanceDownloadBuffer() HttpDownloadPerformanceServer server(UploadSize, true, false); QNetworkRequest request(QUrl("http://127.0.0.1:" + QString::number(server.serverPort()) + "/?bare=1")); - if (useDownloadBuffer) + if (testType == JustDownloadBuffer || testType == DownloadBufferButUseRead) request.setAttribute(QNetworkRequest::MaximumDownloadBufferSizeAttribute, 1024*1024*128); // 128 MB is max allowed QNetworkAccessManager manager; QNetworkReplyPtr reply = manager.get(request); - HttpDownloadPerformanceClientDownloadBuffer client(reply, useDownloadBuffer, UploadSize); + HttpDownloadPerformanceClientDownloadBuffer client(reply, testType, UploadSize); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection); - QBENCHMARK { + QBENCHMARK_ONCE { QTestEventLoop::instance().enterLoop(40); QCOMPARE(reply->error(), QNetworkReply::NoError); + QVERIFY(reply->isFinished()); QVERIFY(!QTestEventLoop::instance().timeout()); } } diff --git a/tests/benchmarks/network/network.pro b/tests/benchmarks/network/network.pro index ea0f821d5c..73de556664 100644 --- a/tests/benchmarks/network/network.pro +++ b/tests/benchmarks/network/network.pro @@ -2,4 +2,5 @@ TEMPLATE = subdirs SUBDIRS = \ access \ kernel \ + ssl \ socket diff --git a/tests/benchmarks/network/ssl/qsslsocket/qsslsocket.pro b/tests/benchmarks/network/ssl/qsslsocket/qsslsocket.pro new file mode 100644 index 0000000000..da34a028d3 --- /dev/null +++ b/tests/benchmarks/network/ssl/qsslsocket/qsslsocket.pro @@ -0,0 +1,13 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = tst_bench_qsslsocket +DEPENDPATH += . +INCLUDEPATH += . + +QT -= gui +QT += network + +CONFIG += release + +# Input +SOURCES += tst_qsslsocket.cpp diff --git a/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp new file mode 100644 index 0000000000..79f502cea0 --- /dev/null +++ b/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (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 Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtTest/QtTest> + +#include <qcoreapplication.h> +#include <qsslconfiguration.h> +#include <qsslsocket.h> + + +// #include "../../../../auto/network-settings.h" + +//TESTED_CLASS= +//TESTED_FILES= + +class tst_QSslSocket : public QObject +{ + Q_OBJECT + +public: + tst_QSslSocket(); + virtual ~tst_QSslSocket(); + + +public slots: + void initTestCase_data(); + void init(); + void cleanup(); +private slots: + void systemCaCertificates(); +}; + +tst_QSslSocket::tst_QSslSocket() +{ +} + +tst_QSslSocket::~tst_QSslSocket() +{ +} + +void tst_QSslSocket::initTestCase_data() +{ +} + +void tst_QSslSocket::init() +{ +} + +void tst_QSslSocket::cleanup() +{ +} + +//---------------------------------------------------------------------------------- +void tst_QSslSocket::systemCaCertificates() +{ + // The results of this test change if the benchmarking system changes too much. + // Therefore this benchmark is only good for manual regression checking between + // Qt versions. + QBENCHMARK_ONCE { + QList<QSslCertificate> list = QSslSocket::systemCaCertificates(); + } +} + +QTEST_MAIN(tst_QSslSocket) +#include "tst_qsslsocket.moc" diff --git a/tests/benchmarks/network/ssl/ssl.pro b/tests/benchmarks/network/ssl/ssl.pro new file mode 100644 index 0000000000..0c8529d2f7 --- /dev/null +++ b/tests/benchmarks/network/ssl/ssl.pro @@ -0,0 +1,3 @@ +TEMPLATE = subdirs +SUBDIRS = \ + qsslsocket |