add unit test for QMetaMethod::revision
Change-Id: I724702d8ac9a75fefd848afccf4f4de9fc0ba4af Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>bb10
parent
fa987d4441
commit
649d834443
|
|
@ -48,6 +48,7 @@ private slots:
|
|||
void fromSignal();
|
||||
|
||||
void gadget();
|
||||
void revision();
|
||||
|
||||
void returnMetaType();
|
||||
void parameterMetaType();
|
||||
|
|
@ -781,11 +782,21 @@ class MyTestClass : public QObject
|
|||
public:
|
||||
MyTestClass() {};
|
||||
public Q_SLOTS:
|
||||
MyGadget doStuff(int, float, MyGadget) {return {};}
|
||||
Q_REVISION(42) MyGadget doStuff(int, float, MyGadget) {return {};}
|
||||
Q_SIGNALS:
|
||||
QObject *mySignal();
|
||||
};
|
||||
|
||||
void tst_QMetaMethod::revision()
|
||||
{
|
||||
auto mo = MyTestClass::staticMetaObject;
|
||||
const auto normalized = QMetaObject::normalizedSignature("doStuff(int, float, MyGadget)");
|
||||
const int idx = mo.indexOfSlot(normalized);
|
||||
QMetaMethod mm = mo.method(idx);
|
||||
QVERIFY(mm.isValid());
|
||||
QCOMPARE(QTypeRevision::fromEncodedVersion(mm.revision()), QTypeRevision::fromMinorVersion(42));
|
||||
}
|
||||
|
||||
void tst_QMetaMethod::returnMetaType()
|
||||
{
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue