Can you commit that?<br><br>Big thanks for this work, i was something I wanted to look at for some time but never found the time to do so.<br><br>Really, thanks :).<br><br>Aleix<br><br><div class="gmail_quote">On Sat, May 23, 2009 at 11:18 PM, Peter Oberndorfer <span dir="ltr"><<a href="mailto:kumbayo84@arcor.de">kumbayo84@arcor.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">vm.insert CMAKE_CURRENT_SOURCE_DIR is needed since 953842<br>
where a Q_ASSERT was added to make sure CMAKE_CURRENT_SOURCE_DIR is defined<br>
<br>
addDocumentChain in testUses is needed to avoid assert indexed.data() == context<br>
in removeDocumentChain that fires when a addDocumentChain was never called<br>
<br>
addDocumentChain + removeDocumentChain testDUChainWalk<br>
are needed to avoid assert m_recursiveImports.isEmpty()<br>
in TopDUContextLocalPrivate::clearImportedContextsRecursively<br>
---<br>
<br>
I am no duchain/cmake expert, so please review carefully.<br>
Also i don't know if addDocumentChain + removeDocumentChain<br>
is the right cure for the m_recursiveImports.isEmpty() assert.<br>
<br>
If it is, i plan to fix cmake_cmakeprojectvisitor_test.cpp the same way.<br>
(it also triggers the m_recursiveImports.isEmpty() assert)<br>
<br>
 projectmanagers/cmake/tests/cmakeduchaintest.cpp |    6 ++++++<br>
 1 files changed, 6 insertions(+), 0 deletions(-)<br>
<br>
diff --git a/projectmanagers/cmake/tests/cmakeduchaintest.cpp b/projectmanagers/cmake/tests/cmakeduchaintest.cpp<br>
index 1b5f56f..ec0e625 100644<br>
--- a/projectmanagers/cmake/tests/cmakeduchaintest.cpp<br>
+++ b/projectmanagers/cmake/tests/cmakeduchaintest.cpp<br>
@@ -83,6 +83,7 @@ void CMakeDUChainTest::testDUChainWalk()<br>
     {<br>
         DUChainWriteLocker lock(DUChain::lock());<br>
         m_fakeContext = new TopDUContext(IndexedString("test"), SimpleRange(0,0,0,0));<br>
+        DUChain::self()->addDocumentChain(m_fakeContext);<br>
     }<br>
<br>
     QFile file("cmake_duchain_test");<br>
@@ -98,6 +99,7 @@ void CMakeDUChainTest::testDUChainWalk()<br>
     MacroMap mm;<br>
     VariableMap vm;<br>
     CacheValues cv;<br>
+    vm.insert("CMAKE_CURRENT_SOURCE_DIR", QStringList("."));<br>
<br>
     CMakeProjectVisitor v(file.fileName(), m_fakeContext);<br>
     v.setVariableMap(&vm);<br>
@@ -135,6 +137,8 @@ void CMakeDUChainTest::testDUChainWalk()<br>
             qDebug() << "doesn't exist " << sr.start.column << sr.end.column;<br>
         QVERIFY(found);<br>
     }<br>
+<br>
+    DUChain::self()->removeDocumentChain(m_fakeContext);<br>
 }<br>
<br>
 void CMakeDUChainTest::testUses_data()<br>
@@ -209,6 +213,7 @@ void CMakeDUChainTest::testUses()<br>
         }<br>
     }<br>
     ReferencedTopDUContext m_fakeContext=new TopDUContext(IndexedString(file.fileName()), SimpleRange(0,0, endl, endc));<br>
+    DUChain::self()->addDocumentChain(m_fakeContext);<br>
<br>
     QString inputIncluded=<br>
         "set(avalue 33)\n"<br>
@@ -227,6 +232,7 @@ void CMakeDUChainTest::testUses()<br>
     MacroMap mm;<br>
     VariableMap vm;<br>
     CacheValues cv;<br>
+    vm.insert("CMAKE_CURRENT_SOURCE_DIR", QStringList("."));<br>
<br>
     CMakeProjectVisitor v(file.fileName(), m_fakeContext);<br>
     v.setVariableMap(&vm);<br>
<font color="#888888">--<br>
1.6.3.1<br>
<br>
<br>
_______________________________________________<br>
KDevelop-devel mailing list<br>
<a href="mailto:KDevelop-devel@kdevelop.org">KDevelop-devel@kdevelop.org</a><br>
<a href="https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel" target="_blank">https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel</a><br>
</font></blockquote></div><br>