diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-01-14 02:59:33 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-01-14 02:59:33 (GMT) |
commit | 6e75c9b3a22500e48d47d0d646f69483fb0a56f2 (patch) | |
tree | 7e2fc0f10c6de70667b4f082f912d44dbc844561 /tests/benchmarks | |
parent | 8e9ec9b982808feb3608e3f9b4d4caf13b65428c (diff) | |
parent | 2ec89699a6f372ccbd92ce2bda753ec0e28f8650 (diff) | |
download | Qt-6e75c9b3a22500e48d47d0d646f69483fb0a56f2.zip Qt-6e75c9b3a22500e48d47d0d646f69483fb0a56f2.tar.gz Qt-6e75c9b3a22500e48d47d0d646f69483fb0a56f2.tar.bz2 |
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests/benchmarks')
79 files changed, 612 insertions, 90 deletions
diff --git a/tests/benchmarks/benchmarks.pro b/tests/benchmarks/benchmarks.pro index 2979ffc..7ea4f24 100644 --- a/tests/benchmarks/benchmarks.pro +++ b/tests/benchmarks/benchmarks.pro @@ -8,6 +8,7 @@ SUBDIRS = containers-associative \ qhostinfo \ qpainter \ qtestlib-simple events \ + qtext \ qiodevice \ qpixmap \ blendbench \ @@ -37,6 +38,7 @@ SUBDIRS = containers-associative \ qstringbuilder \ qstylesheetstyle \ qsvgrenderer \ + qtcpserver \ qtableview \ qthreadstorage diff --git a/tests/benchmarks/blendbench/main.cpp b/tests/benchmarks/blendbench/main.cpp index 55eff8a..92d1633 100644 --- a/tests/benchmarks/blendbench/main.cpp +++ b/tests/benchmarks/blendbench/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/containers-associative/main.cpp b/tests/benchmarks/containers-associative/main.cpp index 55c81ec..4c6dae4 100644 --- a/tests/benchmarks/containers-associative/main.cpp +++ b/tests/benchmarks/containers-associative/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/containers-sequential/main.cpp b/tests/benchmarks/containers-sequential/main.cpp index 885db3e..a6e405c 100644 --- a/tests/benchmarks/containers-sequential/main.cpp +++ b/tests/benchmarks/containers-sequential/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/events/main.cpp b/tests/benchmarks/events/main.cpp index 09d6c53..0dd2c18 100644 --- a/tests/benchmarks/events/main.cpp +++ b/tests/benchmarks/events/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/opengl/main.cpp b/tests/benchmarks/opengl/main.cpp index 04aaa7f..beb4d43 100644 --- a/tests/benchmarks/opengl/main.cpp +++ b/tests/benchmarks/opengl/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qanimation/dummyanimation.cpp b/tests/benchmarks/qanimation/dummyanimation.cpp index 5072936..f79cc5b 100644 --- a/tests/benchmarks/qanimation/dummyanimation.cpp +++ b/tests/benchmarks/qanimation/dummyanimation.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qanimation/dummyanimation.h b/tests/benchmarks/qanimation/dummyanimation.h index 9b2e26c..1df76be 100644 --- a/tests/benchmarks/qanimation/dummyanimation.h +++ b/tests/benchmarks/qanimation/dummyanimation.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qanimation/dummyobject.cpp b/tests/benchmarks/qanimation/dummyobject.cpp index bc343d1..2b66cda 100644 --- a/tests/benchmarks/qanimation/dummyobject.cpp +++ b/tests/benchmarks/qanimation/dummyobject.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qanimation/dummyobject.h b/tests/benchmarks/qanimation/dummyobject.h index 82d1c40..31614fd 100644 --- a/tests/benchmarks/qanimation/dummyobject.h +++ b/tests/benchmarks/qanimation/dummyobject.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qanimation/main.cpp b/tests/benchmarks/qanimation/main.cpp index e0700c6..8b9884e 100644 --- a/tests/benchmarks/qanimation/main.cpp +++ b/tests/benchmarks/qanimation/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qanimation/rectanimation.cpp b/tests/benchmarks/qanimation/rectanimation.cpp index 88eec4d..e6d7a7e 100644 --- a/tests/benchmarks/qanimation/rectanimation.cpp +++ b/tests/benchmarks/qanimation/rectanimation.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qanimation/rectanimation.h b/tests/benchmarks/qanimation/rectanimation.h index 38a6f48..42b9376 100644 --- a/tests/benchmarks/qanimation/rectanimation.h +++ b/tests/benchmarks/qanimation/rectanimation.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qapplication/main.cpp b/tests/benchmarks/qapplication/main.cpp index 0ec65a8..c912497 100644 --- a/tests/benchmarks/qapplication/main.cpp +++ b/tests/benchmarks/qapplication/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qbytearray/main.cpp b/tests/benchmarks/qbytearray/main.cpp index 78c5b16..22d4815 100644 --- a/tests/benchmarks/qbytearray/main.cpp +++ b/tests/benchmarks/qbytearray/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qdir/tst_qdir.cpp b/tests/benchmarks/qdir/tst_qdir.cpp index 64c6ba1..aea9fd0 100644 --- a/tests/benchmarks/qdir/tst_qdir.cpp +++ b/tests/benchmarks/qdir/tst_qdir.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qdiriterator/main.cpp b/tests/benchmarks/qdiriterator/main.cpp index 9e4e53e..afa6b7b 100644 --- a/tests/benchmarks/qdiriterator/main.cpp +++ b/tests/benchmarks/qdiriterator/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qdiriterator/qfilesystemiterator.cpp b/tests/benchmarks/qdiriterator/qfilesystemiterator.cpp index 57167c0..267d53f 100644 --- a/tests/benchmarks/qdiriterator/qfilesystemiterator.cpp +++ b/tests/benchmarks/qdiriterator/qfilesystemiterator.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qdiriterator/qfilesystemiterator.h b/tests/benchmarks/qdiriterator/qfilesystemiterator.h index 7e21282..4aad3a1 100644 --- a/tests/benchmarks/qdiriterator/qfilesystemiterator.h +++ b/tests/benchmarks/qdiriterator/qfilesystemiterator.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qfile/main.cpp b/tests/benchmarks/qfile/main.cpp index 4217077..103b77c 100644 --- a/tests/benchmarks/qfile/main.cpp +++ b/tests/benchmarks/qfile/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qfile_vs_qnetworkaccessmanager/main.cpp b/tests/benchmarks/qfile_vs_qnetworkaccessmanager/main.cpp index ed40d5c..907ffb7 100644 --- a/tests/benchmarks/qfile_vs_qnetworkaccessmanager/main.cpp +++ b/tests/benchmarks/qfile_vs_qnetworkaccessmanager/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qfileinfo/main.cpp b/tests/benchmarks/qfileinfo/main.cpp index 711209c..025787f 100644 --- a/tests/benchmarks/qfileinfo/main.cpp +++ b/tests/benchmarks/qfileinfo/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp index 81064d7..faacec4 100644 --- a/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp +++ b/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp index 8abbe0d..ac51072 100644 --- a/tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/benchmarks/qgraphicsitem/tst_qgraphicsitem.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/benchmarks/qgraphicsscene/tst_qgraphicsscene.cpp index 1944219..5bd07f9 100644 --- a/tests/benchmarks/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/benchmarks/qgraphicsscene/tst_qgraphicsscene.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -64,6 +64,7 @@ private slots: void addItem(); void itemAt_data(); void itemAt(); + void initialShow(); }; tst_QGraphicsScene::tst_QGraphicsScene() @@ -227,5 +228,21 @@ void tst_QGraphicsScene::itemAt() qApp->processEvents(); } +void tst_QGraphicsScene::initialShow() +{ + QGraphicsScene scene; + + QBENCHMARK { + for (int y = 0; y < 30000; ++y) { + QGraphicsRectItem *item = new QGraphicsRectItem(0, 0, 50, 50); + item->setPos((y/2) * item->rect().width(), (y/2) * item->rect().height()); + scene.addItem(item); + } + scene.itemAt(0, 0); // triggers indexing + //This call polish the items so we bench their processing too. + qApp->processEvents(); + } +} + QTEST_MAIN(tst_QGraphicsScene) #include "tst_qgraphicsscene.moc" diff --git a/tests/benchmarks/qgraphicsview/benchapps/chipTest/chip.cpp b/tests/benchmarks/qgraphicsview/benchapps/chipTest/chip.cpp index 7f385d6..77b86c1 100644 --- a/tests/benchmarks/qgraphicsview/benchapps/chipTest/chip.cpp +++ b/tests/benchmarks/qgraphicsview/benchapps/chipTest/chip.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qgraphicsview/benchapps/chipTest/chip.h b/tests/benchmarks/qgraphicsview/benchapps/chipTest/chip.h index 4ef01da..9db23f9 100644 --- a/tests/benchmarks/qgraphicsview/benchapps/chipTest/chip.h +++ b/tests/benchmarks/qgraphicsview/benchapps/chipTest/chip.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qgraphicsview/benchapps/chipTest/main.cpp b/tests/benchmarks/qgraphicsview/benchapps/chipTest/main.cpp index 80a5b69..ea2f94a 100644 --- a/tests/benchmarks/qgraphicsview/benchapps/chipTest/main.cpp +++ b/tests/benchmarks/qgraphicsview/benchapps/chipTest/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qgraphicsview/benchapps/chipTest/mainwindow.cpp b/tests/benchmarks/qgraphicsview/benchapps/chipTest/mainwindow.cpp index f7af394..452b42c 100644 --- a/tests/benchmarks/qgraphicsview/benchapps/chipTest/mainwindow.cpp +++ b/tests/benchmarks/qgraphicsview/benchapps/chipTest/mainwindow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qgraphicsview/benchapps/chipTest/mainwindow.h b/tests/benchmarks/qgraphicsview/benchapps/chipTest/mainwindow.h index 62d618c..558bbef 100644 --- a/tests/benchmarks/qgraphicsview/benchapps/chipTest/mainwindow.h +++ b/tests/benchmarks/qgraphicsview/benchapps/chipTest/mainwindow.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qgraphicsview/benchapps/chipTest/view.cpp b/tests/benchmarks/qgraphicsview/benchapps/chipTest/view.cpp index 9f1f232..1028f42 100644 --- a/tests/benchmarks/qgraphicsview/benchapps/chipTest/view.cpp +++ b/tests/benchmarks/qgraphicsview/benchapps/chipTest/view.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qgraphicsview/benchapps/chipTest/view.h b/tests/benchmarks/qgraphicsview/benchapps/chipTest/view.h index 7f5fdfd..fc5c226 100644 --- a/tests/benchmarks/qgraphicsview/benchapps/chipTest/view.h +++ b/tests/benchmarks/qgraphicsview/benchapps/chipTest/view.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qgraphicsview/benchapps/moveItems/main.cpp b/tests/benchmarks/qgraphicsview/benchapps/moveItems/main.cpp index 147dde8..527713f 100644 --- a/tests/benchmarks/qgraphicsview/benchapps/moveItems/main.cpp +++ b/tests/benchmarks/qgraphicsview/benchapps/moveItems/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qgraphicsview/benchapps/scrolltest/main.cpp b/tests/benchmarks/qgraphicsview/benchapps/scrolltest/main.cpp index 75a6ecd..7419206 100644 --- a/tests/benchmarks/qgraphicsview/benchapps/scrolltest/main.cpp +++ b/tests/benchmarks/qgraphicsview/benchapps/scrolltest/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qgraphicsview/chiptester/chip.cpp b/tests/benchmarks/qgraphicsview/chiptester/chip.cpp index 05ae669..4c1020a 100644 --- a/tests/benchmarks/qgraphicsview/chiptester/chip.cpp +++ b/tests/benchmarks/qgraphicsview/chiptester/chip.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qgraphicsview/chiptester/chip.h b/tests/benchmarks/qgraphicsview/chiptester/chip.h index 4ef01da..9db23f9 100644 --- a/tests/benchmarks/qgraphicsview/chiptester/chip.h +++ b/tests/benchmarks/qgraphicsview/chiptester/chip.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qgraphicsview/chiptester/chiptester.cpp b/tests/benchmarks/qgraphicsview/chiptester/chiptester.cpp index 9caf3f9..8cada67 100644 --- a/tests/benchmarks/qgraphicsview/chiptester/chiptester.cpp +++ b/tests/benchmarks/qgraphicsview/chiptester/chiptester.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qgraphicsview/chiptester/chiptester.h b/tests/benchmarks/qgraphicsview/chiptester/chiptester.h index 8c47327..1a73bb7 100644 --- a/tests/benchmarks/qgraphicsview/chiptester/chiptester.h +++ b/tests/benchmarks/qgraphicsview/chiptester/chiptester.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qgraphicsview/tst_qgraphicsview.cpp b/tests/benchmarks/qgraphicsview/tst_qgraphicsview.cpp index cf65e5d..d98a2a1 100644 --- a/tests/benchmarks/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/benchmarks/qgraphicsview/tst_qgraphicsview.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/benchmarks/qgraphicswidget/tst_qgraphicswidget.cpp index 59d90c7..7db98ce 100644 --- a/tests/benchmarks/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/benchmarks/qgraphicswidget/tst_qgraphicswidget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qhostinfo/main.cpp b/tests/benchmarks/qhostinfo/main.cpp index 389443b..0ae1b7f 100644 --- a/tests/benchmarks/qhostinfo/main.cpp +++ b/tests/benchmarks/qhostinfo/main.cpp @@ -1,17 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** 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$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. +** 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 @@ -25,19 +25,21 @@ ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ + + #include <QDebug> #include <QHostInfo> #include <QStringList> diff --git a/tests/benchmarks/qimagereader/tst_qimagereader.cpp b/tests/benchmarks/qimagereader/tst_qimagereader.cpp index 5ad44be..3f38d19 100644 --- a/tests/benchmarks/qimagereader/tst_qimagereader.cpp +++ b/tests/benchmarks/qimagereader/tst_qimagereader.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qiodevice/main.cpp b/tests/benchmarks/qiodevice/main.cpp index de6d337..4af697c 100644 --- a/tests/benchmarks/qiodevice/main.cpp +++ b/tests/benchmarks/qiodevice/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qmatrix4x4/tst_qmatrix4x4.cpp b/tests/benchmarks/qmatrix4x4/tst_qmatrix4x4.cpp index f80b579..e962198 100644 --- a/tests/benchmarks/qmatrix4x4/tst_qmatrix4x4.cpp +++ b/tests/benchmarks/qmatrix4x4/tst_qmatrix4x4.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qmetaobject/main.cpp b/tests/benchmarks/qmetaobject/main.cpp index fe34c75..c375a16 100644 --- a/tests/benchmarks/qmetaobject/main.cpp +++ b/tests/benchmarks/qmetaobject/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qnetworkreply/tst_qnetworkreply.cpp b/tests/benchmarks/qnetworkreply/tst_qnetworkreply.cpp index 1d50013..6327123 100644 --- a/tests/benchmarks/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/benchmarks/qnetworkreply/tst_qnetworkreply.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -561,15 +561,15 @@ void tst_qnetworkreply::httpUploadPerformance() generator.start(); time.start(); QTestEventLoop::instance().enterLoop(40); + qint64 elapsed = time.elapsed(); + reader.exit(); + reader.wait(); + QVERIFY(reply->isFinished()); QCOMPARE(reply->error(), QNetworkReply::NoError); QVERIFY(!QTestEventLoop::instance().timeout()); - qint64 elapsed = time.elapsed(); qDebug() << "tst_QNetworkReply::httpUploadPerformance" << elapsed << "msec, " << ((UploadSize/1024.0)/(elapsed/1000.0)) << " kB/sec"; - - reader.exit(); - reader.wait(); } diff --git a/tests/benchmarks/qobject/main.cpp b/tests/benchmarks/qobject/main.cpp index 77b4f34..7f24ebd 100644 --- a/tests/benchmarks/qobject/main.cpp +++ b/tests/benchmarks/qobject/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qobject/object.cpp b/tests/benchmarks/qobject/object.cpp index 46f8bc8..d775a32 100644 --- a/tests/benchmarks/qobject/object.cpp +++ b/tests/benchmarks/qobject/object.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qobject/object.h b/tests/benchmarks/qobject/object.h index 56160d7..7e4933f 100644 --- a/tests/benchmarks/qobject/object.h +++ b/tests/benchmarks/qobject/object.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qpainter/tst_qpainter.cpp b/tests/benchmarks/qpainter/tst_qpainter.cpp index 272e481..7c6634e 100644 --- a/tests/benchmarks/qpainter/tst_qpainter.cpp +++ b/tests/benchmarks/qpainter/tst_qpainter.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qpixmap/tst_qpixmap.cpp b/tests/benchmarks/qpixmap/tst_qpixmap.cpp index 7e9f0a3..9ffbefb 100644 --- a/tests/benchmarks/qpixmap/tst_qpixmap.cpp +++ b/tests/benchmarks/qpixmap/tst_qpixmap.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qpixmapcache/tst_qpixmapcache.cpp b/tests/benchmarks/qpixmapcache/tst_qpixmapcache.cpp index 6fdd0d1..1031ba7 100644 --- a/tests/benchmarks/qpixmapcache/tst_qpixmapcache.cpp +++ b/tests/benchmarks/qpixmapcache/tst_qpixmapcache.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qquaternion/tst_qquaternion.cpp b/tests/benchmarks/qquaternion/tst_qquaternion.cpp index 244eddd..7930092 100644 --- a/tests/benchmarks/qquaternion/tst_qquaternion.cpp +++ b/tests/benchmarks/qquaternion/tst_qquaternion.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qrect/main.cpp b/tests/benchmarks/qrect/main.cpp index 5937cd0..e293bfa 100644 --- a/tests/benchmarks/qrect/main.cpp +++ b/tests/benchmarks/qrect/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qregexp/main.cpp b/tests/benchmarks/qregexp/main.cpp index 5b26f36..ab9ed71 100644 --- a/tests/benchmarks/qregexp/main.cpp +++ b/tests/benchmarks/qregexp/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qregion/main.cpp b/tests/benchmarks/qregion/main.cpp index 8a1f603..3d16e41 100644 --- a/tests/benchmarks/qregion/main.cpp +++ b/tests/benchmarks/qregion/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qscriptclass/tst_qscriptclass.cpp b/tests/benchmarks/qscriptclass/tst_qscriptclass.cpp index 29cf275..7985028 100644 --- a/tests/benchmarks/qscriptclass/tst_qscriptclass.cpp +++ b/tests/benchmarks/qscriptclass/tst_qscriptclass.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qscriptengine/tst_qscriptengine.cpp b/tests/benchmarks/qscriptengine/tst_qscriptengine.cpp index 1c787e9..b42a355 100644 --- a/tests/benchmarks/qscriptengine/tst_qscriptengine.cpp +++ b/tests/benchmarks/qscriptengine/tst_qscriptengine.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qscriptvalue/tst_qscriptvalue.cpp b/tests/benchmarks/qscriptvalue/tst_qscriptvalue.cpp index f61f8b5..3bfc21c 100644 --- a/tests/benchmarks/qscriptvalue/tst_qscriptvalue.cpp +++ b/tests/benchmarks/qscriptvalue/tst_qscriptvalue.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qstring/main.cpp b/tests/benchmarks/qstring/main.cpp index 1ec7ee0..298c784 100644 --- a/tests/benchmarks/qstring/main.cpp +++ b/tests/benchmarks/qstring/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qstringbuilder/main.cpp b/tests/benchmarks/qstringbuilder/main.cpp index a15a2c3..9bd146f 100644 --- a/tests/benchmarks/qstringbuilder/main.cpp +++ b/tests/benchmarks/qstringbuilder/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qstringlist/main.cpp b/tests/benchmarks/qstringlist/main.cpp index a2a1dd5..3fac598 100644 --- a/tests/benchmarks/qstringlist/main.cpp +++ b/tests/benchmarks/qstringlist/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qstylesheetstyle/main.cpp b/tests/benchmarks/qstylesheetstyle/main.cpp index d6fa48c..226b661 100644 --- a/tests/benchmarks/qstylesheetstyle/main.cpp +++ b/tests/benchmarks/qstylesheetstyle/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qsvgrenderer/tst_qsvgrenderer.cpp b/tests/benchmarks/qsvgrenderer/tst_qsvgrenderer.cpp index 539c4ea..895ffe0 100644 --- a/tests/benchmarks/qsvgrenderer/tst_qsvgrenderer.cpp +++ b/tests/benchmarks/qsvgrenderer/tst_qsvgrenderer.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qtableview/tst_qtableview.cpp b/tests/benchmarks/qtableview/tst_qtableview.cpp index 7247a23..a84d8b5 100644 --- a/tests/benchmarks/qtableview/tst_qtableview.cpp +++ b/tests/benchmarks/qtableview/tst_qtableview.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qtcpserver/qtcpserver.pro b/tests/benchmarks/qtcpserver/qtcpserver.pro new file mode 100644 index 0000000..e7bf13a --- /dev/null +++ b/tests/benchmarks/qtcpserver/qtcpserver.pro @@ -0,0 +1,13 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = tst_qtcpserver +DEPENDPATH += . +INCLUDEPATH += . + +QT -= gui +QT += network + +CONFIG += release + +# Input +SOURCES += tst_qtcpserver.cpp diff --git a/tests/benchmarks/qtcpserver/tst_qtcpserver.cpp b/tests/benchmarks/qtcpserver/tst_qtcpserver.cpp new file mode 100644 index 0000000..b6b55c3 --- /dev/null +++ b/tests/benchmarks/qtcpserver/tst_qtcpserver.cpp @@ -0,0 +1,277 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// Just to get Q_OS_SYMBIAN +#include <qglobal.h> + +#include <QtTest/QtTest> + + +#include <qcoreapplication.h> +#include <qtcpsocket.h> +#include <qtcpserver.h> +#include <qhostaddress.h> +#include <qprocess.h> +#include <qstringlist.h> +#include <qplatformdefs.h> +#include <qhostinfo.h> + +#include <QNetworkProxy> +Q_DECLARE_METATYPE(QNetworkProxy) +Q_DECLARE_METATYPE(QList<QNetworkProxy>) + +#include "../../auto/network-settings.h" + +//TESTED_CLASS= +//TESTED_FILES= + +class tst_QTcpServer : public QObject +{ + Q_OBJECT + +public: + tst_QTcpServer(); + virtual ~tst_QTcpServer(); + + +public slots: + void initTestCase_data(); + void init(); + void cleanup(); +private slots: + void ipv4LoopbackPerformanceTest(); + void ipv6LoopbackPerformanceTest(); + void ipv4PerformanceTest(); +}; + +tst_QTcpServer::tst_QTcpServer() +{ + Q_SET_DEFAULT_IAP +} + +tst_QTcpServer::~tst_QTcpServer() +{ +} + +void tst_QTcpServer::initTestCase_data() +{ + QTest::addColumn<bool>("setProxy"); + QTest::addColumn<int>("proxyType"); + + QTest::newRow("WithoutProxy") << false << 0; + QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy); +} + +void tst_QTcpServer::init() +{ + QFETCH_GLOBAL(bool, setProxy); + if (setProxy) { + QFETCH_GLOBAL(int, proxyType); + if (proxyType == QNetworkProxy::Socks5Proxy) { + QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080)); + } + } +} + +void tst_QTcpServer::cleanup() +{ + QNetworkProxy::setApplicationProxy(QNetworkProxy::DefaultProxy); +} + +//---------------------------------------------------------------------------------- +void tst_QTcpServer::ipv4LoopbackPerformanceTest() +{ + QFETCH_GLOBAL(bool, setProxy); + if (setProxy) + return; + + QTcpServer server; + QVERIFY(server.listen(QHostAddress::LocalHost)); + + QVERIFY(server.isListening()); + + QTcpSocket clientA; + clientA.connectToHost(QHostAddress::LocalHost, server.serverPort()); + QVERIFY(clientA.waitForConnected(5000)); + QVERIFY(clientA.state() == QAbstractSocket::ConnectedState); + + QVERIFY(server.waitForNewConnection()); + QTcpSocket *clientB = server.nextPendingConnection(); + QVERIFY(clientB); + + QByteArray buffer(16384, '@'); + QTime stopWatch; + stopWatch.start(); + qlonglong totalWritten = 0; + while (stopWatch.elapsed() < 5000) { + QVERIFY(clientA.write(buffer.data(), buffer.size()) > 0); + clientA.flush(); + totalWritten += buffer.size(); + while (clientB->waitForReadyRead(100)) { + if (clientB->bytesAvailable() == 16384) + break; + } + clientB->read(buffer.data(), buffer.size()); + clientB->write(buffer.data(), buffer.size()); + clientB->flush(); + totalWritten += buffer.size(); + while (clientA.waitForReadyRead(100)) { + if (clientA.bytesAvailable() == 16384) + break; + } + clientA.read(buffer.data(), buffer.size()); + } + + qDebug("\t\t%s: %.1fMB/%.1fs: %.1fMB/s", + server.serverAddress().toString().toLatin1().constData(), + totalWritten / (1024.0 * 1024.0), + stopWatch.elapsed() / 1000.0, + (totalWritten / (stopWatch.elapsed() / 1000.0)) / (1024 * 1024)); + + delete clientB; +} + +//---------------------------------------------------------------------------------- +void tst_QTcpServer::ipv6LoopbackPerformanceTest() +{ + QFETCH_GLOBAL(bool, setProxy); + if (setProxy) + return; + +#if defined(Q_OS_SYMBIAN) + QSKIP("Symbian: IPv6 is not yet supported", SkipAll); +#endif + QTcpServer server; + if (!server.listen(QHostAddress::LocalHostIPv6, 0)) { + QVERIFY(server.serverError() == QAbstractSocket::UnsupportedSocketOperationError); + } else { + QTcpSocket clientA; + clientA.connectToHost(server.serverAddress(), server.serverPort()); + QVERIFY(clientA.waitForConnected(5000)); + + QVERIFY(server.waitForNewConnection(5000)); + QTcpSocket *clientB = server.nextPendingConnection(); + QVERIFY(clientB); + + QByteArray buffer(16384, '@'); + QTime stopWatch; + stopWatch.start(); + qlonglong totalWritten = 0; + while (stopWatch.elapsed() < 5000) { + clientA.write(buffer.data(), buffer.size()); + clientA.flush(); + totalWritten += buffer.size(); + while (clientB->waitForReadyRead(100)) { + if (clientB->bytesAvailable() == 16384) + break; + } + clientB->read(buffer.data(), buffer.size()); + clientB->write(buffer.data(), buffer.size()); + clientB->flush(); + totalWritten += buffer.size(); + while (clientA.waitForReadyRead(100)) { + if (clientA.bytesAvailable() == 16384) + break; + } + clientA.read(buffer.data(), buffer.size()); + } + + qDebug("\t\t%s: %.1fMB/%.1fs: %.1fMB/s", + server.serverAddress().toString().toLatin1().constData(), + totalWritten / (1024.0 * 1024.0), + stopWatch.elapsed() / 1000.0, + (totalWritten / (stopWatch.elapsed() / 1000.0)) / (1024 * 1024)); + delete clientB; + } +} + +//---------------------------------------------------------------------------------- +void tst_QTcpServer::ipv4PerformanceTest() +{ + QTcpSocket probeSocket; + probeSocket.connectToHost(QtNetworkSettings::serverName(), 143); + QVERIFY(probeSocket.waitForConnected(5000)); + + QTcpServer server; + QVERIFY(server.listen(probeSocket.localAddress(), 0)); + + QTcpSocket clientA; + clientA.connectToHost(server.serverAddress(), server.serverPort()); + QVERIFY(clientA.waitForConnected(5000)); + + QVERIFY(server.waitForNewConnection(5000)); + QTcpSocket *clientB = server.nextPendingConnection(); + QVERIFY(clientB); + + QByteArray buffer(16384, '@'); + QTime stopWatch; + stopWatch.start(); + qlonglong totalWritten = 0; + while (stopWatch.elapsed() < 5000) { + qlonglong writtenA = clientA.write(buffer.data(), buffer.size()); + clientA.flush(); + totalWritten += buffer.size(); + while (clientB->waitForReadyRead(100)) { + if (clientB->bytesAvailable() == writtenA) + break; + } + clientB->read(buffer.data(), buffer.size()); + qlonglong writtenB = clientB->write(buffer.data(), buffer.size()); + clientB->flush(); + totalWritten += buffer.size(); + while (clientA.waitForReadyRead(100)) { + if (clientA.bytesAvailable() == writtenB) + break; + } + clientA.read(buffer.data(), buffer.size()); + } + + qDebug("\t\t%s: %.1fMB/%.1fs: %.1fMB/s", + probeSocket.localAddress().toString().toLatin1().constData(), + totalWritten / (1024.0 * 1024.0), + stopWatch.elapsed() / 1000.0, + (totalWritten / (stopWatch.elapsed() / 1000.0)) / (1024 * 1024)); + + delete clientB; +} + +QTEST_MAIN(tst_QTcpServer) +#include "tst_qtcpserver.moc" diff --git a/tests/benchmarks/qtemporaryfile/main.cpp b/tests/benchmarks/qtemporaryfile/main.cpp index 546f6c8..8b71189 100644 --- a/tests/benchmarks/qtemporaryfile/main.cpp +++ b/tests/benchmarks/qtemporaryfile/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qtestlib-simple/main.cpp b/tests/benchmarks/qtestlib-simple/main.cpp index bbd1af1..a8dabe9 100644 --- a/tests/benchmarks/qtestlib-simple/main.cpp +++ b/tests/benchmarks/qtestlib-simple/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qtext/bidi.txt b/tests/benchmarks/qtext/bidi.txt new file mode 100644 index 0000000..7c74cb4 --- /dev/null +++ b/tests/benchmarks/qtext/bidi.txt @@ -0,0 +1,4 @@ +chinese +欧洲,软件+互联网
用统一码 (Unicode) 走遍世界
将于1997年 3 月10日-12日在德国 Mainz 市举行的第十届统一码国际研讨会现在开始注册。 本次会议将汇集各方面的专家。 涉及的领域包括: 国际互联网和统一码 ,国际化和本地化 ,统一码在操作系统和应用软件中的实现 ,字型 ,文本格式以及多文种计算等。
当世界需要沟通时,请用Unicode! +hebrew-bidi +אײראָפּע: פּראָגראַמװאַרג און די װעלטנעץ: אוניקאָד איבער דער גאָרער װעלט פֿאַרשרײַבט זיך שױן אױף דער צענטער אינטערנאַציאָנאַלער אוניקאָד-קאָנפֿערענץ, װאָס װעט פֿאָרקומען דעם 10טן ביזן 12טן מאַרץ, 1997, אין מײַנץ, דײַטשלאַנד. די קאָנפֿערענץ װעט צוזאַמענברענגן מבֿינים פֿון װעלטנעץ, אוניקאָד, אי אַלװעלטלעכן אי סבֿיבֿהדיקן פּראָגראַמװאַרג, אַרײַנשטעלן אוניקאָד אין אָפּעריר-סיסטעמען און אָנװענדונגען, שריפֿטן, טעקסט-אױסשטעל, און מערשפּראַכיקע קאָמפּיוטערײַ. diff --git a/tests/benchmarks/qtext/main.cpp b/tests/benchmarks/qtext/main.cpp new file mode 100644 index 0000000..4bd2bee --- /dev/null +++ b/tests/benchmarks/qtext/main.cpp @@ -0,0 +1,200 @@ +/**************************************************************************** +** +** 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 <QDebug> +#include <QTextDocument> +#include <QTextDocumentWriter> +#include <QTextLayout> +#include <QTextCursor> +#include <QFile> +#include <QBuffer> +#include <qtest.h> + +Q_DECLARE_METATYPE(QTextDocument*) + +class tst_QText: public QObject +{ + Q_OBJECT +public: + tst_QText() { + m_lorem = QString::fromLatin1("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi."); + } + +private slots: + void loadHtml_data(); + void loadHtml(); + + void shaping_data(); + void shaping(); + + void odfWriting_empty(); + void odfWriting_text(); + void odfWriting_images(); + +private: + QString m_lorem; +}; + +void tst_QText::loadHtml_data() +{ + QTest::addColumn<QString>("source"); + QTest::newRow("empty") << QString(); + QTest::newRow("simple") << QString::fromLatin1("<html><b>Foo</b></html>"); + QTest::newRow("simple2") << QString::fromLatin1("<b>Foo</b>"); + + QString parag = QString::fromLatin1("<p>%1</p>").arg(m_lorem); + QString header = QString::fromLatin1("<html><head><title>test</title></head><body>"); + QTest::newRow("long") << QString::fromLatin1("<html><head><title>test</title></head><body>") + parag + parag + parag + + parag + parag + parag + parag + parag + parag + parag + parag + parag + parag + parag + parag + parag + parag + + QString::fromLatin1("</html>"); + QTest::newRow("table") << header + QLatin1String("<table border=\"1\"1><tr><td>xx</td></tr><tr><td colspan=\"2\">") + + parag + QLatin1String("</td></tr></table></html"); + QTest::newRow("crappy") << header + QLatin1String("<table border=\"1\"1><tr><td>xx</td></tr><tr><td colspan=\"2\">") + + parag; +} + +void tst_QText::loadHtml() +{ + QFETCH(QString, source); + QTextDocument doc; + QBENCHMARK { + doc.setHtml(source); + } +} + +void tst_QText::shaping_data() +{ + QTest::addColumn<QString>("parag"); + QTest::newRow("empty") << QString(); + QTest::newRow("lorem") << m_lorem; + QTest::newRow("short") << QString::fromLatin1("Lorem ipsum dolor sit amet"); + + QFile file(QString::fromLatin1(SRCDIR) + QLatin1String("/bidi.txt")); + QVERIFY(file.open(QFile::ReadOnly)); + QByteArray data = file.readAll(); + QVERIFY(data.count() > 1000); + QStringList list = QString::fromUtf8(data.data()).split(QLatin1Char('\n'), QString::SkipEmptyParts); + QVERIFY(list.count() %2 == 0); // even amount as we have title and then content. + for (int i=0; i < list.count(); i+=2) { + QTest::newRow(list.at(i).toLatin1()) << list.at(i+1); + } +} + +void tst_QText::shaping() +{ + QFETCH(QString, parag); + + QTextLayout lay(parag); + lay.setCacheEnabled(false); + + // do one run to make sure any fonts are loaded. + lay.beginLayout(); + lay.createLine(); + lay.endLayout(); + + QBENCHMARK { + lay.beginLayout(); + lay.createLine(); + lay.endLayout(); + } +} + +void tst_QText::odfWriting_empty() +{ + QVERIFY(QTextDocumentWriter::supportedDocumentFormats().contains("ODF")); // odf compiled in + QTextDocument *doc = new QTextDocument(); + // write it + QBENCHMARK { + QBuffer buffer; + buffer.open(QIODevice::WriteOnly); + QTextDocumentWriter writer(&buffer, "ODF"); + writer.write(doc); + } + delete doc; +} + +void tst_QText::odfWriting_text() +{ + QTextDocument *doc = new QTextDocument(); + QTextCursor cursor(doc); + QTextBlockFormat bf; + bf.setIndent(2); + cursor.insertBlock(bf); + cursor.insertText(m_lorem); + bf.setTopMargin(10); + cursor.insertBlock(bf); + cursor.insertText(m_lorem); + bf.setRightMargin(30); + cursor.insertBlock(bf); + cursor.insertText(m_lorem); + + // write it + QBENCHMARK { + QBuffer buffer; + buffer.open(QIODevice::WriteOnly); + QTextDocumentWriter writer(&buffer, "ODF"); + writer.write(doc); + } + delete doc; +} + +void tst_QText::odfWriting_images() +{ + QTextDocument *doc = new QTextDocument(); + QTextCursor cursor(doc); + cursor.insertText(m_lorem); + QImage image(400, 200, QImage::Format_ARGB32_Premultiplied); + cursor.insertImage(image); + cursor.insertText(m_lorem); + + // write it + QBENCHMARK { + QBuffer buffer; + buffer.open(QIODevice::WriteOnly); + QTextDocumentWriter writer(&buffer, "ODF"); + writer.write(doc); + } + delete doc; +} + +QTEST_MAIN(tst_QText) + +#include "main.moc" diff --git a/tests/benchmarks/qtext/qtext.pro b/tests/benchmarks/qtext/qtext.pro new file mode 100644 index 0000000..ce4f604 --- /dev/null +++ b/tests/benchmarks/qtext/qtext.pro @@ -0,0 +1,7 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = tst_QText + +SOURCES += main.cpp + +DEFINES += SRCDIR=\\\"$$PWD/\\\" diff --git a/tests/benchmarks/qthreadstorage/tst_qthreadstorage.cpp b/tests/benchmarks/qthreadstorage/tst_qthreadstorage.cpp index c00bf5a..faae4d7 100644 --- a/tests/benchmarks/qthreadstorage/tst_qthreadstorage.cpp +++ b/tests/benchmarks/qthreadstorage/tst_qthreadstorage.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qtransform/tst_qtransform.cpp b/tests/benchmarks/qtransform/tst_qtransform.cpp index 6cb085b..b33cf58 100644 --- a/tests/benchmarks/qtransform/tst_qtransform.cpp +++ b/tests/benchmarks/qtransform/tst_qtransform.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qtwidgets/mainwindow.cpp b/tests/benchmarks/qtwidgets/mainwindow.cpp index 34212e3..bb19567 100644 --- a/tests/benchmarks/qtwidgets/mainwindow.cpp +++ b/tests/benchmarks/qtwidgets/mainwindow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qtwidgets/mainwindow.h b/tests/benchmarks/qtwidgets/mainwindow.h index b3a1242..8a4521a 100644 --- a/tests/benchmarks/qtwidgets/mainwindow.h +++ b/tests/benchmarks/qtwidgets/mainwindow.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qtwidgets/tst_qtwidgets.cpp b/tests/benchmarks/qtwidgets/tst_qtwidgets.cpp index d8a0738..8d2a31b 100644 --- a/tests/benchmarks/qtwidgets/tst_qtwidgets.cpp +++ b/tests/benchmarks/qtwidgets/tst_qtwidgets.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qvariant/tst_qvariant.cpp b/tests/benchmarks/qvariant/tst_qvariant.cpp index 2f2bc02..82dc7dd 100644 --- a/tests/benchmarks/qvariant/tst_qvariant.cpp +++ b/tests/benchmarks/qvariant/tst_qvariant.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tests/benchmarks/qwidget/tst_qwidget.cpp b/tests/benchmarks/qwidget/tst_qwidget.cpp index 28171d3..f21bd44 100644 --- a/tests/benchmarks/qwidget/tst_qwidget.cpp +++ b/tests/benchmarks/qwidget/tst_qwidget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** |