aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppeditor/cppdoxygen_test.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@digia.com>2013-09-27 15:58:50 +0200
committerNikolai Kosjar <nikolai.kosjar@digia.com>2013-09-30 12:13:28 +0200
commitd9602ca550c53e60a5229bfec9539e41fa5a694c (patch)
tree9e0e1c7afc2207c390fdf1d85d58cc86dca326ab /src/plugins/cppeditor/cppdoxygen_test.cpp
parenta12a9f491cb31ff5c22f1051bb22ccfef6c65217 (diff)
CppEditor/CppTools: Fix plugin tests.
Starting with commit 243a625 EditorManager::closeEditors() does not delete the editors anymore, but calls deleteLater(). When the call returns, all kind of checks fail since the editor widget destructor was not yet called. Fixed by providing and calling Core::Tests::closeAndDeleteEditors(), which explicitly sends QEvent::DeferredDelete to the widget. Change-Id: I3287abbe74ccf7d7a18b997a847701c8be17cb55 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/plugins/cppeditor/cppdoxygen_test.cpp')
-rw-r--r--src/plugins/cppeditor/cppdoxygen_test.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/cppeditor/cppdoxygen_test.cpp b/src/plugins/cppeditor/cppdoxygen_test.cpp
index 13d0d2d3a0..5ee9989f60 100644
--- a/src/plugins/cppeditor/cppdoxygen_test.cpp
+++ b/src/plugins/cppeditor/cppdoxygen_test.cpp
@@ -30,6 +30,7 @@
#include "cppeditor.h"
#include <coreplugin/editormanager/editormanager.h>
+#include <coreplugin/plugintestutils.h>
#include <cplusplus/CppDocument.h>
#include <cppeditor/cppeditor.h>
#include <cppeditor/cppeditorplugin.h>
@@ -115,8 +116,7 @@ TestCase::TestCase(const QByteArray &input)
TestCase::~TestCase()
{
- EditorManager::instance()->closeEditors(QList<Core::IEditor *>() << editor, false);
- QCoreApplication::processEvents(); // process any pending events
+ Core::Tests::closeAndDeleteEditor(editor);
// Remove the test file from the code-model
CppTools::CppModelManagerInterface *mmi = CppTools::CppModelManagerInterface::instance();