diff --git a/kdevplatform/language/duchain/tests/test_duchain.cpp b/kdevplatform/language/duchain/tests/test_duchain.cpp --- a/kdevplatform/language/duchain/tests/test_duchain.cpp +++ b/kdevplatform/language/duchain/tests/test_duchain.cpp @@ -921,7 +921,7 @@ IntegralTypeData data; data.m_dataType = IntegralType::TypeInt; data.typeClassId = IntegralType::Identity; - data.inRepository = false; + data.inRepository = true; data.m_modifiers = 42; data.m_dynamic = false; data.refCount = 1; @@ -938,9 +938,10 @@ case 1: TypeSystem::self().dynamicSize(data); break; - case 2: - TypeSystem::self().create(&data); + case 2: { + AbstractType::Ptr t(TypeSystem::self().create(&data)); break; + } case 3: TypeSystem::self().isFactoryLoaded(data); break; @@ -1014,7 +1015,9 @@ QVector contexts; contexts.reserve(10); DUChainWriteLocker lock; - contexts << new TopDUContext(IndexedString("/tmp/something"), {0, 0, INT_MAX, INT_MAX}); + auto topDUContext = new TopDUContext(IndexedString("/tmp/something"), {0, 0, INT_MAX, INT_MAX}); + DUChain::self()->addDocumentChain(topDUContext); + contexts << topDUContext; for (int i = 1; i < contexts.capacity(); ++i) { contexts << new DUContext({0, 0, INT_MAX, INT_MAX}, contexts.at(i-1)); contexts.last()->setLocalScopeIdentifier(QualifiedIdentifier(QString::number(i))); @@ -1028,6 +1031,10 @@ count += dec->qualifiedIdentifier().count(); } QVERIFY(count > 0); + + // manually delete as QScopedPointer does not work well with QBENCHMARK + delete dec; + DUChain::self()->removeDocumentChain(topDUContext); } #include "test_duchain.moc"