summaryrefslogtreecommitdiff
path: root/src/plugins/clangcodemodel/test
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@theqtcompany.com>2016-02-01 14:51:01 +0100
committerMarco Bubke <marco.bubke@theqtcompany.com>2016-02-01 14:01:35 +0000
commitc903f4974f3ed403b1cc4af4f143922d8ebc7961 (patch)
tree8212fe73b701edd3826b8972c76913beec197e4c /src/plugins/clangcodemodel/test
parente42bf6ebc637e9ef4ec95787374c9743eb80d8d4 (diff)
downloadqt-creator-c903f4974f3ed403b1cc4af4f143922d8ebc7961.tar.gz
TextEditor: Introduce AssistProposalItemInterface
For unit test we need to break every dependency to the TextEditor Widget etc.. With an abstract interface we can implement it in clang without relying on unwanted dependencies. It makes it also easier to compute the values deferred. Change-Id: I1b313a1625f4e80bd324ab4bf1a7c4f6b690abe9 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Diffstat (limited to 'src/plugins/clangcodemodel/test')
-rw-r--r--src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp
index 9aae254c1a..54f35b9dca 100644
--- a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp
+++ b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp
@@ -746,10 +746,10 @@ bool hasSnippet(ProposalModel model, const QByteArray &text)
auto *genericModel = static_cast<TextEditor::GenericProposalModel *>(model.data());
for (int i = 0, size = genericModel->size(); i < size; ++i) {
- TextEditor::AssistProposalItem *item = genericModel->proposalItem(i);
+ TextEditor::AssistProposalItemInterface *item = genericModel->proposalItem(i);
QTC_ASSERT(item, continue);
if (item->text() == snippetText)
- return item->data().toString().contains(QLatin1Char('$'));
+ return item->isSnippet();
}
return false;