diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2009-04-17 12:01:04 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2009-04-17 12:01:04 (GMT) |
commit | 198efeb27e5c2a87d0a2bb6859446cb1faf45ed8 (patch) | |
tree | e4c99e89cbecd2084a87a8c7a5d4877385fcec1c /tests/benchmarks | |
parent | bb2e4df9bee3148e819c98410aa36e22dad95d7a (diff) | |
parent | e85867003ca1741f378b1f58f4dd9d48577a5d9b (diff) | |
download | Qt-198efeb27e5c2a87d0a2bb6859446cb1faf45ed8.zip Qt-198efeb27e5c2a87d0a2bb6859446cb1faf45ed8.tar.gz Qt-198efeb27e5c2a87d0a2bb6859446cb1faf45ed8.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-animations
Conflicts:
src/gui/graphicsview/qgraphicsitem.cpp
Diffstat (limited to 'tests/benchmarks')
-rw-r--r-- | tests/benchmarks/qgraphicswidget/qgraphicswidget.pro | 6 | ||||
-rw-r--r-- | tests/benchmarks/qgraphicswidget/tst_qgraphicswidget.cpp | 60 | ||||
-rw-r--r-- | tests/benchmarks/qimagereader/tst_qimagereader.cpp | 2 | ||||
-rw-r--r-- | tests/benchmarks/qobject/main.cpp | 14 | ||||
-rw-r--r-- | tests/benchmarks/qpainter/tst_qpainter.cpp | 6 |
5 files changed, 68 insertions, 20 deletions
diff --git a/tests/benchmarks/qgraphicswidget/qgraphicswidget.pro b/tests/benchmarks/qgraphicswidget/qgraphicswidget.pro new file mode 100644 index 0000000..f1ec54e --- /dev/null +++ b/tests/benchmarks/qgraphicswidget/qgraphicswidget.pro @@ -0,0 +1,6 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = tst_qgraphicswidget +TEMPLATE = app +# Input +SOURCES += tst_qgraphicswidget.cpp diff --git a/tests/benchmarks/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/benchmarks/qgraphicswidget/tst_qgraphicswidget.cpp new file mode 100644 index 0000000..97837e2 --- /dev/null +++ b/tests/benchmarks/qgraphicswidget/tst_qgraphicswidget.cpp @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +****************************************************************************/ + +#include <qtest.h> +#include <QGraphicsItem> +#include <QGraphicsScene> +#include <QGraphicsView> +#include <QGraphicsWidget> +//TESTED_FILES= + +class tst_QGraphicsWidget : public QObject +{ + Q_OBJECT + +public: + tst_QGraphicsWidget(); + virtual ~tst_QGraphicsWidget(); + +public slots: + void init(); + void cleanup(); + +private slots: + void move(); +}; + +tst_QGraphicsWidget::tst_QGraphicsWidget() +{ +} + +tst_QGraphicsWidget::~tst_QGraphicsWidget() +{ +} + +void tst_QGraphicsWidget::init() +{ +} + +void tst_QGraphicsWidget::cleanup() +{ +} + +void tst_QGraphicsWidget::move() +{ + QGraphicsScene scene; + QGraphicsWidget *widget = new QGraphicsWidget(); + scene.addItem(widget); + QGraphicsView view(&scene); + view.show(); + QBENCHMARK { + widget->setPos(qrand(),qrand()); + } +} + +QTEST_MAIN(tst_QGraphicsWidget) +#include "tst_qgraphicswidget.moc" diff --git a/tests/benchmarks/qimagereader/tst_qimagereader.cpp b/tests/benchmarks/qimagereader/tst_qimagereader.cpp index ae7ecb2..1b5acb4 100644 --- a/tests/benchmarks/qimagereader/tst_qimagereader.cpp +++ b/tests/benchmarks/qimagereader/tst_qimagereader.cpp @@ -102,9 +102,7 @@ tst_QImageReader::tst_QImageReader() images << QPair<QString, QByteArray>(QLatin1String("4bpp-rle.bmp"), QByteArray("bmp")); images << QPair<QString, QByteArray>(QLatin1String("tst7.bmp"), QByteArray("bmp")); images << QPair<QString, QByteArray>(QLatin1String("16bpp.bmp"), QByteArray("bmp")); -#if QT_VERSION >= 0x040200 images << QPair<QString, QByteArray>(QLatin1String("negativeheight.bmp"), QByteArray("bmp")); -#endif images << QPair<QString, QByteArray>(QLatin1String("marble.xpm"), QByteArray("xpm")); images << QPair<QString, QByteArray>(QLatin1String("kollada.png"), QByteArray("png")); images << QPair<QString, QByteArray>(QLatin1String("teapot.ppm"), QByteArray("ppm")); diff --git a/tests/benchmarks/qobject/main.cpp b/tests/benchmarks/qobject/main.cpp index cd8b142..65833b8 100644 --- a/tests/benchmarks/qobject/main.cpp +++ b/tests/benchmarks/qobject/main.cpp @@ -42,12 +42,7 @@ #include <QtGui> #include <qtest.h> #include "object.h" - -#if QT_VERSION >= 0x040000 -# include <qcoreapplication.h> -#else -# include <qapplication.h> -#endif +#include <qcoreapplication.h> #include <qdatetime.h> enum { @@ -58,7 +53,7 @@ enum { class QObjectBenchmark : public QObject { Q_OBJECT -private slots: +private slots: void signal_slot_benchmark(); void signal_slot_benchmark_data(); void qproperty_benchmark_data(); @@ -82,13 +77,8 @@ void QObjectBenchmark::signal_slot_benchmark() Object singleObject; Object multiObject; -#if QT_VERSION >= 0x040000 singleObject.setObjectName("single"); multiObject.setObjectName("multi"); -#else - singleObject.setName("single"); - multiObject.setName("double"); -#endif singleObject.connect(&singleObject, SIGNAL(signal0()), SLOT(slot0())); diff --git a/tests/benchmarks/qpainter/tst_qpainter.cpp b/tests/benchmarks/qpainter/tst_qpainter.cpp index af2c412..60c099b 100644 --- a/tests/benchmarks/qpainter/tst_qpainter.cpp +++ b/tests/benchmarks/qpainter/tst_qpainter.cpp @@ -700,11 +700,7 @@ void tst_QPainter::compositionModes_data() QTest::addColumn<QSize>("size"); QTest::addColumn<QColor>("color"); -#if QT_VERSION >= 0x040500 const int n = QPainter::RasterOp_SourceAndNotDestination; -#else - const int n = QPainter::CompositionMode_Exclusion; -#endif for (int i = 0; i <= n; ++i) { QString title("%1:%2"); QTest::newRow(qPrintable(title.arg(i).arg("10x10:opaque"))) @@ -732,9 +728,7 @@ void tst_QPainter::compositionModes() src.fill(color); QPixmap dest(size); -#if QT_VERSION >= 0x040500 if (mode < QPainter::RasterOp_SourceOrDestination) -#endif color.setAlpha(127); // porter-duff needs an alpha channel dest.fill(color); |