summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cpptoolstestcase.h
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@digia.com>2014-09-19 12:32:43 +0200
committerNikolai Kosjar <nikolai.kosjar@digia.com>2014-09-22 10:49:17 +0200
commitaf34a5b9b43119ef0bde6836b26e885664fe6683 (patch)
tree1a6f824188d1e2163e73739503e8f231aea50413 /src/plugins/cpptools/cpptoolstestcase.h
parentfdc982358e89d44e1b087d234ce301b68bb1e6be (diff)
downloadqt-creator-af34a5b9b43119ef0bde6836b26e885664fe6683.tar.gz
CppTools: Tests: Fix leaking IAssistProposal and SymbolSearcher
Change-Id: Ic81a5df88d17375cf0087213d84443845bfd38cc Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Diffstat (limited to 'src/plugins/cpptools/cpptoolstestcase.h')
-rw-r--r--src/plugins/cpptools/cpptoolstestcase.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/plugins/cpptools/cpptoolstestcase.h b/src/plugins/cpptools/cpptoolstestcase.h
index 321e957bc4..fd45f8a32e 100644
--- a/src/plugins/cpptools/cpptoolstestcase.h
+++ b/src/plugins/cpptools/cpptoolstestcase.h
@@ -41,8 +41,13 @@ namespace CPlusPlus {
class Document;
class Snapshot;
}
+
namespace Core { class IEditor; }
-namespace TextEditor { class BaseTextEditor; }
+
+namespace TextEditor {
+class BaseTextEditor;
+class IAssistProposal;
+}
namespace CppTools {
namespace Tests {
@@ -108,6 +113,17 @@ private:
bool m_writtenSuccessfully;
};
+// Normally the proposal is deleted by the ProcessorRunner or the
+// GenericProposalWidget, but in tests we usually don't make use of them.
+class CPPTOOLS_EXPORT IAssistProposalScopedPointer
+{
+public:
+ IAssistProposalScopedPointer(TextEditor::IAssistProposal *proposal);
+ ~IAssistProposalScopedPointer();
+
+ QScopedPointer<TextEditor::IAssistProposal> d;
+};
+
} // namespace Tests
} // namespace CppTools