From f2d174012bcaa88e90a80ec2120182ad9e6e8f48 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Thu, 4 Aug 2016 23:03:23 +0200 Subject: tst_creation: Remove redundant widgets dependency Absolutely no need for this. Change-Id: I06ca2dab157fecf2c585b9f863d9893cd4ce7300 Reviewed-by: Simon Hausmann --- tests/benchmarks/qml/creation/creation.pro | 2 +- tests/benchmarks/qml/creation/tst_creation.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'tests/benchmarks/qml/creation') diff --git a/tests/benchmarks/qml/creation/creation.pro b/tests/benchmarks/qml/creation/creation.pro index c6f0bf7e17..8f5c2edc1d 100644 --- a/tests/benchmarks/qml/creation/creation.pro +++ b/tests/benchmarks/qml/creation/creation.pro @@ -1,7 +1,7 @@ CONFIG += benchmark TEMPLATE = app TARGET = tst_creation -QT += core-private gui-private qml-private quick-private widgets testlib +QT += core-private gui-private qml-private quick-private testlib macx:CONFIG -= app_bundle SOURCES += tst_creation.cpp diff --git a/tests/benchmarks/qml/creation/tst_creation.cpp b/tests/benchmarks/qml/creation/tst_creation.cpp index 38ab577120..b6e2801c99 100644 --- a/tests/benchmarks/qml/creation/tst_creation.cpp +++ b/tests/benchmarks/qml/creation/tst_creation.cpp @@ -36,8 +36,6 @@ #include #include #include -#include -#include #include #include #include -- cgit v1.2.3 From 3631c77ff01f40f83fa59a90c28d69ee9953c327 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Fri, 5 Aug 2016 00:07:45 +0200 Subject: tst_creation: Remove qobject_alloc benchmark This is literally just testing operator new and delete, with a little PLT overhead. It is not useful as a result (not a real-world scenario, and obscenely variant thanks to allocators not being predictable in behavior). Change-Id: I42f758c503b37ff880fc4f0e38c220d0638356e9 Reviewed-by: Simon Hausmann --- tests/benchmarks/qml/creation/tst_creation.cpp | 30 -------------------------- 1 file changed, 30 deletions(-) (limited to 'tests/benchmarks/qml/creation') diff --git a/tests/benchmarks/qml/creation/tst_creation.cpp b/tests/benchmarks/qml/creation/tst_creation.cpp index b6e2801c99..595b8346ca 100644 --- a/tests/benchmarks/qml/creation/tst_creation.cpp +++ b/tests/benchmarks/qml/creation/tst_creation.cpp @@ -50,7 +50,6 @@ private slots: void qobject_cpp(); void qobject_qml(); void qobject_qmltype(); - void qobject_alloc(); void qobject_10flat_qml(); void qobject_10flat_cpp(); @@ -206,35 +205,6 @@ void tst_creation::qobject_qmltype() } } -struct QObjectFakeData { - char data[sizeof(QObjectPrivate)]; -}; - -struct QObjectFake { - QObjectFake(); - virtual ~QObjectFake(); -private: - QObjectFakeData *d; -}; - -QObjectFake::QObjectFake() -{ - d = new QObjectFakeData; -} - -QObjectFake::~QObjectFake() -{ - delete d; -} - -void tst_creation::qobject_alloc() -{ - QBENCHMARK { - QObjectFake *obj = new QObjectFake; - delete obj; - } -} - struct QQmlGraphics_Derived : public QObject { void setParent_noEvent(QObject *parent) { -- cgit v1.2.3 From e0e591fb80ab86f6044e5140ddbbc979c0c8d380 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Fri, 5 Aug 2016 00:22:27 +0200 Subject: tst_creation: Remove tst_creation::elements There is no real sense in testing what boils down to operator new/delete plus a little PLT overhead. For one thing, the allocator is too variant to test at such a level. For another, it's not representative of any real-world scenario. Change-Id: Ib455bb00839ff4e25099977059759a7b328db306 Reviewed-by: Simon Hausmann --- tests/benchmarks/qml/creation/tst_creation.cpp | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'tests/benchmarks/qml/creation') diff --git a/tests/benchmarks/qml/creation/tst_creation.cpp b/tests/benchmarks/qml/creation/tst_creation.cpp index 595b8346ca..dbda07be5a 100644 --- a/tests/benchmarks/qml/creation/tst_creation.cpp +++ b/tests/benchmarks/qml/creation/tst_creation.cpp @@ -64,9 +64,6 @@ private slots: void itemtree_qml(); void itemtree_scene_cpp(); - void elements_data(); - void elements(); - void itemtests_qml_data(); void itemtests_qml(); @@ -299,28 +296,6 @@ void tst_creation::itemtree_scene_cpp() delete root; } -void tst_creation::elements_data() -{ - QTest::addColumn("type"); - - QList types = QQmlMetaType::qmlTypeNames(); - foreach (QString type, types) - QTest::newRow(type.toLatin1()) << type; -} - -void tst_creation::elements() -{ - QFETCH(QString, type); - QQmlType *t = QQmlMetaType::qmlType(type, 2, 0); - if (!t || !t->isCreatable()) - QSKIP("Non-creatable type"); - - QBENCHMARK { - QObject *obj = t->create(); - delete obj; - } -} - void tst_creation::itemtests_qml_data() { QTest::addColumn("filepath"); -- cgit v1.2.3