summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2015-07-28 00:22:48 +0300
committerOrgad Shaneh <orgads@gmail.com>2015-07-28 19:54:36 +0000
commitb1e0731d5513eda1d0cbd18c0a806d3af6e21bdf (patch)
tree8e5bef7dea87fae2b8d30aca4f53bdce7bd23fe2
parentdae0265d43084d949a6f4080750da11c60780291 (diff)
downloadqt-creator-b1e0731d5513eda1d0cbd18c0a806d3af6e21bdf.tar.gz
CppEditor: Add a failing test for ConvertToPointer with macro
Task-number: QTCREATORBUG-14801 Change-Id: Ie34b131de4e6f701aeac29567a09be54e2e63bd8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
-rw-r--r--src/plugins/cppeditor/cppquickfix_test.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp
index 4945fd8ae7..b6f3033bfa 100644
--- a/src/plugins/cppeditor/cppquickfix_test.cpp
+++ b/src/plugins/cppeditor/cppquickfix_test.cpp
@@ -256,6 +256,7 @@ QuickFixOperationTest::QuickFixOperationTest(const QList<QuickFixTestDocument::P
removeTrailingWhitespace(result);
if (!expectedFailMessage.isEmpty())
QEXPECT_FAIL("", expectedFailMessage.data(), Continue);
+ QEXPECT_FAIL("ConvertToPointerWithMacro", "QTCREATORBUG-14801", Abort);
QCOMPARE(result, testDocument->m_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")