summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcompletion_test.cpp
diff options
context:
space:
mode:
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;
}