D18567: Make testActiveDocumentsGetBestPriority() clean up after itself

Milian Wolff noreply at phabricator.kde.org
Sun Mar 10 19:01:11 GMT 2019


mwolff requested changes to this revision.
mwolff added a comment.
This revision now requires changes to proceed.


  cool, this is great! and it fixes the issue you originally found in `testActiveDocumentsGetBestPriority`?

INLINE COMMENTS

> testfile.cpp:128
> +    IDocument* document = ICore::self()->documentController()->documentForUrl(d->url.toUrl());
> +    if (document) {
> +        document->close(KDevelop::IDocument::Discard);

if (auto *document = ICore::self()->...) {
      document->close(...);
  }

> testfile.cpp:134
> +    backgroundParser->removeDocument(d->url, this);
> +    if (backgroundParser->parseJobForDocument(d->url)) {
> +        bool finished = false;

maybe replace this whole if with a simple

  QTRY_VERIFY(!backgroundParser->parseJobForDocument(d->url)));

if I'm not mistaken, it will have the same effect as the multiple lines of code that you wrote!

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D18567

To: thomassc, #kdevelop, mwolff
Cc: mwolff, kdevelop-devel, gennad, glebaccon, domson, antismap, iodelay, alexeymin, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20190310/534bbdb0/attachment.html>


More information about the KDevelop-devel mailing list