MCPcopy Create free account
hub / github.com/KDAB/GammaRay / testStaticProperty

Method testStaticProperty

tests/metaobjecttest.cpp:78–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76 }
77
78 static void testStaticProperty()
79 {
80 auto *mo = MetaObjectRepository::instance()->metaObject(QStringLiteral("QCoreApplication"));
81 QVERIFY(mo);
82 QVERIFY(mo->propertyCount() >= 8); // depends on Qt version
83
84 MetaProperty *prop = nullptr;
85 for (int i = 0; i < mo->propertyCount(); ++i) {
86 prop = mo->propertyAt(i);
87 QVERIFY(prop);
88 if (strcmp(prop->name(), "libraryPaths") == 0)
89 break;
90 }
91
92 QVERIFY(prop);
93 if (!prop)
94 return; // to silence clang-tidy
95 QCOMPARE(prop->name(), "libraryPaths");
96 QCOMPARE(prop->typeName(), "QStringList");
97 QCOMPARE(prop->isReadOnly(), true);
98 QCOMPARE(prop->value(nullptr).toStringList(), QCoreApplication::libraryPaths());
99 }
100};
101
102QTEST_MAIN(MetaObjectTest)

Callers

nothing calls this directly

Calls 7

propertyCountMethod · 0.80
propertyAtMethod · 0.80
metaObjectMethod · 0.45
nameMethod · 0.45
typeNameMethod · 0.45
isReadOnlyMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected