summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcompletion_test.cpp
diff options
context:
space:
mode:
authorPrzemyslaw Gorszkowski <pgorszkowski@gmail.com>2014-04-03 12:16:15 +0200
committerPrzemyslaw Gorszkowski <pgorszkowski@gmail.com>2014-04-04 12:11:02 +0200
commitfaca3333b580aa5dc208d9af90b483ef4a4a2129 (patch)
tree6e219886f1e06945662220cdff94f4f78af903c7 /src/plugins/cpptools/cppcompletion_test.cpp
parentc79413a4bd3405f29dc7366517dfd30b1f9c3d69 (diff)
downloadqt-creator-faca3333b580aa5dc208d9af90b483ef4a4a2129.tar.gz
C++: fix typedef resolving
Fix a case: struct A { int a; }; typedef A B; typedef B* Bptr; Bptr b; b-> Task-number: QTCREATORBUG-10021 Change-Id: Ibf5ca801dbdb72744416924c0b8fc03daad5948a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Diffstat (limited to 'src/plugins/cpptools/cppcompletion_test.cpp')
-rw-r--r--src/plugins/cpptools/cppcompletion_test.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp
index d87f671951..54c150cadc 100644
--- a/src/plugins/cpptools/cppcompletion_test.cpp
+++ b/src/plugins/cpptools/cppcompletion_test.cpp
@@ -2355,4 +2355,28 @@ void CppToolsPlugin::test_completion_member_access_operator_data()
<< QLatin1String("S")
<< QLatin1String("m"))
<< true;
+
+ QTest::newRow("typedef_of_pointer_of_type_replace_access_operator") << _(
+ "struct S { int m; };\n"
+ "typedef struct S SType;\n"
+ "typedef struct SType *STypePtr;\n"
+ "STypePtr p;\n"
+ "@\n"
+ "}\n"
+ ) << _("p.") << (QStringList()
+ << QLatin1String("S")
+ << QLatin1String("m"))
+ << true;
+
+ QTest::newRow("typedef_of_pointer_of_type_no_replace_access_operator") << _(
+ "struct S { int m; };\n"
+ "typedef struct S SType;\n"
+ "typedef struct SType *STypePtr;\n"
+ "STypePtr p;\n"
+ "@\n"
+ "}\n"
+ ) << _("p->") << (QStringList()
+ << QLatin1String("S")
+ << QLatin1String("m"))
+ << false;
}