[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdev-go] duchain/tests: Fix tests
From:       Pavel Petrushkov <onehundredof () gmail ! com>
Date:       2014-09-30 19:59:22
Message-ID: E1XZ3Zy-0000tY-Kz () scm ! kde ! org
[Download RAW message or body]

Git commit 6db4922b478251b13aaa6e7814b1e791d0e07de6 by Pavel Petrushkov.
Committed on 30/09/2014 at 17:50.
Pushed by pavelp into branch 'master'.

Fix tests

M  +5    -2    duchain/tests/testduchain.cpp

http://commits.kde.org/kdev-go/6db4922b478251b13aaa6e7814b1e791d0e07de6

diff --git a/duchain/tests/testduchain.cpp b/duchain/tests/testduchain.cpp
index 205f0b0..784de24 100644
--- a/duchain/tests/testduchain.cpp
+++ b/duchain/tests/testduchain.cpp
@@ -51,9 +51,10 @@ void TestDuchain::sanityCheck()
 {
     QString code("package main; func main() {}");
     ParseSession session(code.toUtf8(), 0);
+    session.setCurrentDocument(IndexedString("file:///temp/1"));
     QVERIFY(session.startParsing());
     DeclarationBuilder builder(&session, false);
-    ReferencedTopDUContext context =  builder.build(IndexedString(""), session.ast());
+    ReferencedTopDUContext context =  builder.build(session.currentDocument(), session.ast());
     QVERIFY(context.data());
 
     DUChainReadLocker lock;
@@ -506,10 +507,12 @@ void TestDuchain::test_literals()
 DUContext* getPackageContext(const QString& code)
 {
     ParseSession session(code.toUtf8(), 0);
+    static int testNumber = 0;
+    session.setCurrentDocument(IndexedString(QString("file:///temp/%1").arg(testNumber++)));
     if(!session.startParsing())
 	return 0;
     DeclarationBuilder builder(&session, false);
-    ReferencedTopDUContext context =  builder.build(IndexedString(""), session.ast());
+    ReferencedTopDUContext context =  builder.build(session.currentDocument(), session.ast());
     if(!context)
 	return 0;
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic