diff options
Diffstat (limited to 'tests/benchmarks')
3 files changed, 9 insertions, 37 deletions
diff --git a/tests/benchmarks/corelib/tools/qstringbuilder/main.cpp b/tests/benchmarks/corelib/tools/qstringbuilder/main.cpp index 9bd146f..d46a36b 100644 --- a/tests/benchmarks/corelib/tools/qstringbuilder/main.cpp +++ b/tests/benchmarks/corelib/tools/qstringbuilder/main.cpp @@ -428,37 +428,6 @@ private: std::string stdr; }; - -//void operator%(QString, int) {} - -int main(int argc, char *argv[]) -{ - //qDebug() << (QString("xx") * QLatin1String("y")).toString(); - //42 % 3; // Sanity test, should always work. - //QString("x") % 2; // Sanity test, should only compile when the - // operator%(QString, int) is visible. - - if (argc == 2 && (QLatin1String(argv[1]) == QLatin1String("--run-builder") - || QLatin1String(argv[1]) == QLatin1String("-b"))) { - tst_qstringbuilder test; - return test.run_builder(); - } - - if (argc == 2 && (QLatin1String(argv[1]) == QLatin1String("--run-traditional") - || QLatin1String(argv[1]) == QLatin1String("-t"))) { - tst_qstringbuilder test; - return test.run_traditional(); - } - - if (argc == 1) { - QCoreApplication app(argc, argv); - QStringList args = app.arguments(); - tst_qstringbuilder test; - return QTest::qExec(&test, argc, argv); - } - - qDebug() << "Usage: " << argv[0] << " [--run-builder|-r|--run-traditional|-t]"; -} - +QTEST_MAIN(tst_qstringbuilder) #include "main.moc" diff --git a/tests/benchmarks/gui/painting/qtbench/benchmarktests.h b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h index 362d121..824825b 100644 --- a/tests/benchmarks/gui/painting/qtbench/benchmarktests.h +++ b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h @@ -540,7 +540,7 @@ public: case StaticTextWithMaximumSizeMode: { QStaticText staticText; m_size = (p->boundingRect(m_bounds, 0, m_text)).size(); - staticText.setMaximumSize(m_size + QSize(10, 10)); + staticText.setTextWidth(m_size.width() + 10); staticText.setText(m_text); staticText.prepare(p->transform(), p->font()); m_staticTexts.append(staticText); @@ -551,7 +551,7 @@ public: for (int i=0; i<iterations; ++i) { QStaticText staticText; staticText.setPerformanceHint(QStaticText::AggressiveCaching); - staticText.setMaximumSize(m_size + QSize(10, 10)); + staticText.setTextWidth(m_size.width() + 10); staticText.setText(m_text); staticText.prepare(p->transform(), p->font()); m_staticTexts.append(staticText); diff --git a/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp index 26308e9..81f6f25 100644 --- a/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp +++ b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp @@ -46,7 +46,6 @@ #include <QtNetwork/qnetworkaccessmanager.h> #include <QtCore/QTemporaryFile> #include <QtCore/QFile> -#include "../../../../auto/network-settings.h" class qfile_vs_qnetworkaccessmanager : public QObject { @@ -78,11 +77,15 @@ void qfile_vs_qnetworkaccessmanager::initTestCase() { testFile.open(); QByteArray qba(1*1024*1024, 'x'); // 1 MB +#ifdef Q_OS_SYMBIAN + for (int i = 0; i < 10; i++) { // for Symbian only 10 MB +#else for (int i = 0; i < 100; i++) { +#endif testFile.write(qba); testFile.flush(); size += qba.size(); - } // 100 MB + } // 100 MB or 10 MB testFile.reset(); } @@ -105,7 +108,7 @@ void qfile_vs_qnetworkaccessmanager::qnamFileRead() { QNetworkAccessManager manager; QTime t; - QNetworkRequest request(QUrl(testFile.fileName())); + QNetworkRequest request(QUrl::fromLocalFile(testFile.fileName())); // do 3 dry runs for cache warmup qnamFileRead_iteration(manager, request); |