From e5ce564b1d2f2818c36ffbabbaa558c091512e66 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 6 Oct 2011 13:25:58 +0200 Subject: Rename QMetaType::construct() to create() create() is symmetric with destroy(). Also rename the internal methods and fields to be consistent (qDeleteHelper already had the "right" name, though!). This change will allow us to use construct() and destruct() for something else: Placement new-style allocation (QTBUG-12574). The old construct() is still kept for now, until the other repositories have been updated to use create(). Change-Id: Iceb184af6cffcb0a634359cfc3516c718ba0c2f5 Reviewed-on: http://codereview.qt-project.org/6342 Sanity-Review: Qt Sanity Bot Reviewed-by: Lars Knoll --- tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp') diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index 3fb60acf57..13d3dede99 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -72,7 +72,7 @@ private slots: void normalizedTypes(); void typeName_data(); void typeName(); - void construct(); + void create(); void typedefs(); void isRegistered_data(); void isRegistered(); @@ -133,15 +133,15 @@ protected: ++failureCount; qWarning() << "Wrong typeName returned for" << tp; } - void *buf = QMetaType::construct(tp, 0); - void *buf2 = QMetaType::construct(tp, buf); + void *buf = QMetaType::create(tp, 0); + void *buf2 = QMetaType::create(tp, buf); if (!buf) { ++failureCount; - qWarning() << "Null buffer returned by QMetaType::construct(tp, 0)"; + qWarning() << "Null buffer returned by QMetaType::create(tp, 0)"; } if (!buf2) { ++failureCount; - qWarning() << "Null buffer returned by QMetaType::construct(tp, buf)"; + qWarning() << "Null buffer returned by QMetaType::create(tp, buf)"; } QMetaType::destroy(tp, buf); QMetaType::destroy(tp, buf2); @@ -268,10 +268,10 @@ void tst_QMetaType::typeName() QCOMPARE(QString::fromLatin1(QMetaType::typeName(aType)), aTypeName); } -void tst_QMetaType::construct() +void tst_QMetaType::create() { QSize x(1, 1); - void *size = QMetaType::construct(QMetaType::QSize, &x); + void *size = QMetaType::create(QMetaType::QSize, &x); QVERIFY(size); QCOMPARE(static_cast(size)->width(), 1); QMetaType::destroy(QMetaType::QSize, size); -- cgit v1.2.3