DocumentController::openDocument(KUrl) fails in QtTest

Martin Heide Martin.Heide at
Wed Feb 16 16:29:06 UTC 2011


I could need some help for QtTests concerning the DocumentController:

I'm trying to write a test for a feature that I implemented. The test should open several files and verify the position of the Sublime::Views that are created.

My problem is, when I call 
in my test function, I get 

QDEBUG : ShellBuddyTest::testDeclarationDefinitionOrder() qttest(23628)/kdevplatform (language) KDevelop::BackgroundParser::documentLoaded: Creating change tracker for  KUrl("file:///home/martin/tmp/a.cpp")
QFATAL : ShellBuddyTest::testDeclarationDefinitionOrder() ASSERT: "KDevelop::ForegroundLock::isLockedForThread()" in file /home/martin/d/src/kdevplatform/language/backgroundparser/documentchangetracker.cpp, line 108
FAIL!  : ShellBuddyTest::testDeclarationDefinitionOrder() Received a fatal error.
   Loc: [Unknown file(0)]

and the test fails. This happens as well with an already-existing file, as well if I create the file on-the-fly in the test (KTempDir, create a QFile inside).

Is there someone who can tell me how to properly open documents inside QtTests? If I use
instead (like it is done in kdevplatform/shell/tests/shelldocumentoperationtest.cpp), i get no error. So the problem must be related somehow with the access to the filesystem, I think.
The assert that fails is in void DocumentChangeTracker::reset().

I verified that opening documents by the user in the Kdevelop GUI works well, it fails only in the QtTest.

Thanks for your help!
Regards, Martin

Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro!

More information about the KDevelop-devel mailing list