diff options
author | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2013-07-22 13:58:47 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2013-07-23 09:58:47 +0200 |
commit | a8cbaa1ea107cfc9af09061ec32b60b65fb7039a (patch) | |
tree | cbe05b1b934b88b84db6c1cd489971da76d795dc /src/plugins/cppeditor/fileandtokenactions_test.cpp | |
parent | fb5a5688f7f67264b461b111369e44a5a9504e7e (diff) | |
download | qt-creator-a8cbaa1ea107cfc9af09061ec32b60b65fb7039a.tar.gz |
CppEditor: Tests: Fix blocking the token tests by a pop up
Now the used QuickFixFactory InsertVirtualMethods is configured to not
generate any pop ups.
Change-Id: I36d297678d87e6fb2eb0a73fea6384f0eb7e21f0
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Diffstat (limited to 'src/plugins/cppeditor/fileandtokenactions_test.cpp')
-rw-r--r-- | src/plugins/cppeditor/fileandtokenactions_test.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/plugins/cppeditor/fileandtokenactions_test.cpp b/src/plugins/cppeditor/fileandtokenactions_test.cpp index 0538ad842f..0670b0fa5b 100644 --- a/src/plugins/cppeditor/fileandtokenactions_test.cpp +++ b/src/plugins/cppeditor/fileandtokenactions_test.cpp @@ -34,9 +34,11 @@ #include <cppeditor/cppeditor.h> #include <cppeditor/cppeditorplugin.h> #include <cppeditor/cppquickfixassistant.h> +#include <cppeditor/cppquickfixes.h> #include <cppeditor/cppquickfix.h> -#include <cpptools/cpptoolsplugin.h> +#include <cppeditor/cppquickfix_test_utils.h> #include <cpptools/cppmodelmanagerinterface.h> +#include <cpptools/cpptoolsplugin.h> #include <extensionsystem/pluginmanager.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/project.h> @@ -469,7 +471,19 @@ void RunAllQuickFixesTokenAction::run(CPPEditorWidget *editorWidget) foreach (CppQuickFixFactory *quickFixFactory, quickFixFactories) { TextEditor::QuickFixOperations operations; - quickFixFactory->match(qfi, operations); + // Some Quick Fixes pop up a dialog and are therefore inappropriate for this test. + // Where possible, use a guiless version of the factory. + if (qobject_cast<InsertVirtualMethods *>(quickFixFactory)) { + QScopedPointer<CppQuickFixFactory> factoryProducingGuiLessOperations; + factoryProducingGuiLessOperations.reset( + new InsertVirtualMethods( + new InsertVirtualMethodsDialogTest( + InsertVirtualMethodsDialog::ModeOutsideClass, true))); + factoryProducingGuiLessOperations->match(qfi, operations); + } else { + quickFixFactory->match(qfi, operations); + } + foreach (QuickFixOperation::Ptr operation, operations) { qDebug() << " -- Performing Quick Fix" << operation->description(); operation->perform(); |