From b1e0731d5513eda1d0cbd18c0a806d3af6e21bdf Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 28 Jul 2015 00:22:48 +0300 Subject: [PATCH] CppEditor: Add a failing test for ConvertToPointer with macro Task-number: QTCREATORBUG-14801 Change-Id: Ie34b131de4e6f701aeac29567a09be54e2e63bd8 Reviewed-by: Nikolai Kosjar --- src/plugins/cppeditor/cppquickfix_test.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index 4945fd8ae7f..b6f3033bfa2 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -256,6 +256,7 @@ QuickFixOperationTest::QuickFixOperationTest(const QListm_expectedSource); // Undo the change @@ -1720,6 +1721,23 @@ void CppEditorPlugin::test_quickfix_data() " f2(str);\n" "}\n"); + QTest::newRow("ConvertToPointerWithMacro") + << CppQuickFixFactoryPtr(new ConvertFromAndToPointer) + << _("#define BAR bar\n" + "void func()\n" + "{\n" + " int @foo = 42;\n" + " int bar;\n" + " BAR = foo;\n" + "}\n") + << _("#define BAR bar\n" + "void func()\n" + "{\n" + " int *foo = 42;\n" + " int bar;\n" + " BAR = *foo;\n" + "}\n"); + QTest::newRow("InsertQtPropertyMembers_noTriggerInvalidCode") << CppQuickFixFactoryPtr(new InsertQtPropertyMembers) << _("class C { @Q_PROPERTY(typeid foo READ foo) };\n")