summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-02-18 23:16:24 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-29 12:50:14 +0100
commit96f2365cf4cebc074c3171878dcd25ce19ee7486 (patch)
tree188bde357226f7c86adf11618bbaac8e53020f97 /tests/auto/corelib/kernel/qobject/tst_qobject.cpp
parent3f7a222414fc9d3e9f2e2cfdd05f33740c5afb7e (diff)
Rename QMetaMethod::signature() to methodSignature()
In Qt5 the meta-data format will be changed to not store the method signature string explicitly; the signature will be reconstructed on demand from the method name and parameter type information. The QMetaMethod::signature() method returns a const char pointer. Changing the return type to QByteArray can lead to silent bugs due to the implicit conversion to char *. Even though it's a source- incompatible change, it's therefore better to introduce a new function, methodSignature(), and remove the old signature(). Task-number: QTBUG-24154 Change-Id: Ib3579dedd27a3c7c8914d5f1b231947be2cf4027 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Diffstat (limited to 'tests/auto/corelib/kernel/qobject/tst_qobject.cpp')
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index a6ad1d53bc..c6667ff2a8 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -1793,56 +1793,56 @@ void tst_QObject::metamethod()
QMetaMethod m;
m = mobj->method(mobj->indexOfMethod("invoke1()"));
- QVERIFY(QByteArray(m.signature()) == "invoke1()");
+ QVERIFY(m.methodSignature() == "invoke1()");
QVERIFY(m.methodType() == QMetaMethod::Method);
QVERIFY(m.access() == QMetaMethod::Public);
QVERIFY(!(m.attributes() & QMetaMethod::Scriptable));
QVERIFY(!(m.attributes() & QMetaMethod::Compatibility));
m = mobj->method(mobj->indexOfMethod("sinvoke1()"));
- QVERIFY(QByteArray(m.signature()) == "sinvoke1()");
+ QVERIFY(m.methodSignature() == "sinvoke1()");
QVERIFY(m.methodType() == QMetaMethod::Method);
QVERIFY(m.access() == QMetaMethod::Public);
QVERIFY((m.attributes() & QMetaMethod::Scriptable));
QVERIFY(!(m.attributes() & QMetaMethod::Compatibility));
m = mobj->method(mobj->indexOfMethod("invoke2()"));
- QVERIFY(QByteArray(m.signature()) == "invoke2()");
+ QVERIFY(m.methodSignature() == "invoke2()");
QVERIFY(m.methodType() == QMetaMethod::Method);
QVERIFY(m.access() == QMetaMethod::Protected);
QVERIFY(!(m.attributes() & QMetaMethod::Scriptable));
QVERIFY((m.attributes() & QMetaMethod::Compatibility));
m = mobj->method(mobj->indexOfMethod("sinvoke2()"));
- QVERIFY(QByteArray(m.signature()) == "sinvoke2()");
+ QVERIFY(m.methodSignature() == "sinvoke2()");
QVERIFY(m.methodType() == QMetaMethod::Method);
QVERIFY(m.access() == QMetaMethod::Protected);
QVERIFY((m.attributes() & QMetaMethod::Scriptable));
QVERIFY((m.attributes() & QMetaMethod::Compatibility));
m = mobj->method(mobj->indexOfMethod("invoke3()"));
- QVERIFY(QByteArray(m.signature()) == "invoke3()");
+ QVERIFY(m.methodSignature() == "invoke3()");
QVERIFY(m.methodType() == QMetaMethod::Method);
QVERIFY(m.access() == QMetaMethod::Private);
QVERIFY(!(m.attributes() & QMetaMethod::Scriptable));
QVERIFY(!(m.attributes() & QMetaMethod::Compatibility));
m = mobj->method(mobj->indexOfMethod("sinvoke3()"));
- QVERIFY(QByteArray(m.signature()) == "sinvoke3()");
+ QVERIFY(m.methodSignature() == "sinvoke3()");
QVERIFY(m.methodType() == QMetaMethod::Method);
QVERIFY(m.access() == QMetaMethod::Private);
QVERIFY((m.attributes() & QMetaMethod::Scriptable));
QVERIFY(!(m.attributes() & QMetaMethod::Compatibility));
m = mobj->method(mobj->indexOfMethod("signal5()"));
- QVERIFY(QByteArray(m.signature()) == "signal5()");
+ QVERIFY(m.methodSignature() == "signal5()");
QVERIFY(m.methodType() == QMetaMethod::Signal);
QVERIFY(m.access() == QMetaMethod::Protected);
QVERIFY(!(m.attributes() & QMetaMethod::Scriptable));
QVERIFY((m.attributes() & QMetaMethod::Compatibility));
m = mobj->method(mobj->indexOfMethod("aPublicSlot()"));
- QVERIFY(QByteArray(m.signature()) == "aPublicSlot()");
+ QVERIFY(m.methodSignature() == "aPublicSlot()");
QVERIFY(m.methodType() == QMetaMethod::Slot);
QVERIFY(m.access() == QMetaMethod::Public);
QVERIFY(!(m.attributes() & QMetaMethod::Scriptable));