Unbreak most of the clang codecompletion test by passing file contents

Authored by mwolff on Jan 8 2018, 12:01 AM.



Since the introduction of the CXUnsavedFile for the current document
in the code completion (commit f14a8fc9 from July 2017 [!!!]) the
unit tests where failing. The reason was that clang only saw empty
file contents when the code completion context was created with
no text. Previously, this used to fall-back to the actual file
on-disk. Nowadays, this fallback does not exist anymore, thus we
always have to pass the text in the unit tests. Do this and cleanup
the code by sharing more code in functions.

Diff Detail

R32 KDevelop
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
mwolff created this revision.Jan 8 2018, 12:01 AM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptJan 8 2018, 12:01 AM
mwolff requested review of this revision.Jan 8 2018, 12:01 AM
kfunk accepted this revision.Jan 9 2018, 7:24 AM
kfunk added a subscriber: kfunk.
kfunk added inline comments.

Q_ASSERT(doc); to be sure?

This revision is now accepted and ready to land.Jan 9 2018, 7:24 AM
This revision was automatically updated to reflect the committed changes.