DocumentController::openDocument(KUrl) fails in QtTest

Martin Heide Martin.Heide at gmx.net
Fri Feb 18 11:36:07 UTC 2011


Hi,
thanks very much for your help! I should have checked that before asking.

Opening documents now works well in QtTests, so either a bug was fixed on the master in the meantime, or we introduced a bug in our new code. Merging the changes of the master into our branch will show which is the case.

Martin



-------- Original-Nachricht --------
> Datum: Wed, 16 Feb 2011 18:30:32 +0100
> Von: Milian Wolff <mail at milianw.de>
> An: KDevelop Developer Mailinglist <kdevelop-devel at barney.cs.uni-potsdam.de>
> Betreff: Re: DocumentController::openDocument(KUrl) fails in QtTest

> On 02/16/11 17:29, Martin Heide wrote:
> > Hi,
> >
> > 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
> >
> Core::self()->documentController()->openDocument(KUrl("/path/file.cpp"));
> > 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
> > Core::self()->documentController()->openDocumentFromText("Test1");
> > 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.
> 
> What version of KDevelop is that - most recent git master? David changed 
> a few things in the way the Foreground lock is initially acquired, so it 
> might be related. But first make sure you are actually up to date.
> 
> bye
> 
> -- 
> Milian Wolff
> http://milianw.de
> 
> -- 
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de




More information about the KDevelop-devel mailing list