summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-06-26 17:41:59 +0200
committerMarc Mutz <marc.mutz@kdab.com>2019-08-12 20:41:46 +0200
commite125e6837cf9a85506206fbef6a7aa716ebcb559 (patch)
tree8318f0e8db63a501f35687188562bbfc9ff49542 /tests/auto/corelib/kernel
parent49400214e0562e519f918bd88496eda91816c0e0 (diff)
QObject: remove the undocumented userData() feature
Change-Id: I74445b964eb32bf60f389fcb50bd4929de01230e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/corelib/kernel')
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp48
1 files changed, 0 insertions, 48 deletions
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index a805bfb747..676999a08c 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -81,9 +81,6 @@ private slots:
void senderTest();
void declareInterface();
void qpointerResetBeforeDestroyedSignal();
-#ifndef QT_NO_USERDATA
- void testUserData();
-#endif
void childDeletesItsSibling();
void dynamicProperties();
void floatProperty();
@@ -2341,51 +2338,6 @@ void tst_QObject::declareInterface()
}
-#ifndef QT_NO_USERDATA
-class CustomData : public QObjectUserData
-{
-public:
- int id;
-};
-
-void tst_QObject::testUserData()
-{
- const int USER_DATA_COUNT = 100;
- int user_data_ids[USER_DATA_COUNT];
-
- // Register a few
- for (int i=0; i<USER_DATA_COUNT; ++i) {
- user_data_ids[i] = QObject::registerUserData();
- }
-
- // Randomize the table a bit
- for (int i=0; i<100; ++i) {
- int p1 = QRandomGenerator::global()->bounded(USER_DATA_COUNT);
- int p2 = QRandomGenerator::global()->bounded(USER_DATA_COUNT);
-
- int tmp = user_data_ids[p1];
- user_data_ids[p1] = user_data_ids[p2];
- user_data_ids[p2] = tmp;
- }
-
- // insert the user data into an object
- QObject my_test_object;
- for (int i=0; i<USER_DATA_COUNT; ++i) {
- CustomData *data = new CustomData;
- data->id = user_data_ids[i];
- my_test_object.setUserData(data->id, data);
- }
-
- // verify that all ids and positions are matching
- for (int i=0; i<USER_DATA_COUNT; ++i) {
- int id = user_data_ids[i];
- CustomData *data = static_cast<CustomData *>(my_test_object.userData(id));
- QVERIFY(data != nullptr);
- QCOMPARE(data->id, id);
- }
-}
-#endif // QT_NO_USERDATA
-
class DestroyedListener : public QObject
{
Q_OBJECT