Commit 2475da1b authored by Christian Stenger's avatar Christian Stenger

Replace some more occurrences of QStringList() << pattern

Change-Id: Ic7193ac3a741763479a9ef129ed05cb7ca64f1e9
Reviewed-by: default avatarhjk <hjk@qt.io>
parent 38b6f4ff
......@@ -167,11 +167,10 @@ void AutoTestUnitTests::testCodeParserSwitchStartup_data()
QTest::addColumn<QList<int> >("expectedUnnamedQuickTestsCount");
QTest::addColumn<QList<int> >("expectedDataTagsCount");
QStringList projects = QStringList()
<< QString(m_tmpDir->path() + QLatin1String("/plain/plain.pro"))
<< QString(m_tmpDir->path() + QLatin1String("/mixed_atp/mixed_atp.pro"))
<< QString(m_tmpDir->path() + QLatin1String("/plain/plain.qbs"))
<< QString(m_tmpDir->path() + QLatin1String("/mixed_atp/mixed_atp.qbs"));
QStringList projects = QStringList({ m_tmpDir->path() + "/plain/plain.pro",
m_tmpDir->path() + "/mixed_atp/mixed_atp.pro",
m_tmpDir->path() + "/plain/plain.qbs",
m_tmpDir->path() + "/mixed_atp/mixed_atp.qbs" });
QList<int> expectedAutoTests = QList<int>() << 1 << 4 << 1 << 4;
QList<int> expectedNamedQuickTests = QList<int>() << 0 << 5 << 0 << 5;
......
......@@ -371,17 +371,12 @@ void CppToolsPlugin::test_global_completion_data()
const QByteArray codeTemplate = "int myGlobal;\n"
"<REPLACEMENT>\n"
"@\n";
const QStringList replacements = QStringList()
<< QLatin1String("// text")
<< QLatin1String("// text.")
<< QLatin1String("/// text")
<< QLatin1String("/// text.")
;
const QStringList replacements = QStringList({ "// text", "// text.", "/// text", "/// text." });
foreach (const QString &replacement, replacements) {
QByteArray code = codeTemplate;
code.replace("<REPLACEMENT>", replacement.toUtf8());
const QByteArray tag = _("completion after comment: ") + replacement.toUtf8();
QTest::newRow(tag) << code << QByteArray() << QStringList(QLatin1String("myGlobal"));
QTest::newRow(tag) << code << QByteArray() << QStringList("myGlobal");
}
}
......@@ -432,24 +427,14 @@ static void enumTestCase(const QByteArray &tag, const QByteArray &source,
QByteArray fullSource = source;
fullSource.replace('$', "enum E { val1, val2, val3 };");
QTest::newRow(tag) << fullSource << (prefix + "val")
<< (QStringList()
<< QLatin1String("val1")
<< QLatin1String("val2")
<< QLatin1String("val3"));
<< QStringList({ "val1", "val2", "val3" });
QTest::newRow(tag + "_cxx11") << fullSource << (prefix + "E::")
<< (QStringList()
<< QLatin1String("E")
<< QLatin1String("val1")
<< QLatin1String("val2")
<< QLatin1String("val3"));
<< QStringList({ "E", "val1", "val2", "val3" });
fullSource.replace("enum E ", "enum ");
QTest::newRow(tag + "_anon") << fullSource << (prefix + "val")
<< (QStringList()
<< QLatin1String("val1")
<< QLatin1String("val2")
<< QLatin1String("val3"));
<< QStringList({ "val1", "val2", "val3" });
}
void CppToolsPlugin::test_completion_data()
......@@ -471,8 +456,7 @@ void CppToolsPlugin::test_completion_data()
"};\n"
"\n"
"@\n"
) << _("Foo::Bar::") << (QStringList()
<< QLatin1String("Bar"));
) << _("Foo::Bar::") << QStringList("Bar");
QTest::newRow("inside_parentheses_c_style_conversion") << _(
"class Base\n"
......@@ -491,11 +475,7 @@ void CppToolsPlugin::test_completion_data()
" if (1)\n"
" @;\n"
"}\n"
) << _("((Derived *)b)->") << (QStringList()
<< QLatin1String("Derived")
<< QLatin1String("Base")
<< QLatin1String("i_derived")
<< QLatin1String("i_base"));
) << _("((Derived *)b)->") << QStringList({ "Derived", "Base", "i_derived", "i_base" });
QTest::newRow("inside_parentheses_cast_operator_conversion") << _(
"class Base\n"
......@@ -514,11 +494,8 @@ void CppToolsPlugin::test_completion_data()
" if (1)\n"
" @;\n"
"}\n"
) << _("(static_cast<Derived *>(b))->") << (QStringList()
<< QLatin1String("Derived")
<< QLatin1String("Base")
<< QLatin1String("i_derived")
<< QLatin1String("i_base"));
) << _("(static_cast<Derived *>(b))->") << QStringList({ "Derived", "Base", "i_derived",
"i_base" });
QTest::newRow("template_1") << _(
"template <class T>\n"
......@@ -533,11 +510,7 @@ void CppToolsPlugin::test_completion_data()
" Foo f;\n"
" @\n"
"}"
) << _("Foo::") << (QStringList()
<< QLatin1String("Foo")
<< QLatin1String("Type")
<< QLatin1String("foo")
<< QLatin1String("m"));
) << _("Foo::") << QStringList({ "Foo", "Type", "foo", "m" });
QTest::newRow("template_2") << _(
"template <class T>\n"
......@@ -552,10 +525,7 @@ void CppToolsPlugin::test_completion_data()
" List<Tupple> l;\n"
" @\n"
"}"
) << _("l.at(0).") << (QStringList()
<< QLatin1String("Tupple")
<< QLatin1String("a")
<< QLatin1String("b"));
) << _("l.at(0).") << QStringList({ "Tupple", "a", "b" });
QTest::newRow("template_3") << _(
"template <class T>\n"
......@@ -570,10 +540,7 @@ void CppToolsPlugin::test_completion_data()
" List<Tupple> l;\n"
" @\n"
"}"
) << _("l.t.") << (QStringList()
<< QLatin1String("Tupple")
<< QLatin1String("a")
<< QLatin1String("b"));
) << _("l.t.") << QStringList({ "Tupple", "a", "b" });
QTest::newRow("template_4") << _(
"template <class T>\n"
......@@ -589,10 +556,7 @@ void CppToolsPlugin::test_completion_data()
" List<Tupple> l;\n"
" @\n"
"}"
) << _("l.u.") << (QStringList()
<< QLatin1String("Tupple")
<< QLatin1String("a")
<< QLatin1String("b"));
) << _("l.u.") << QStringList({ "Tupple", "a", "b" });
QTest::newRow("template_5") << _(
"template <class T>\n"
......@@ -608,10 +572,7 @@ void CppToolsPlugin::test_completion_data()
" LT l;"
" @\n"
"}"
) << _("l.u.") << (QStringList()
<< QLatin1String("Tupple")
<< QLatin1String("a")
<< QLatin1String("b"));
) << _("l.u.") << QStringList({ "Tupple", "a", "b" });
QTest::newRow("template_6") << _(
"class Item\n"
......@@ -631,9 +592,7 @@ void CppToolsPlugin::test_completion_data()
"{};\n"
"ItemContainer container;\n"
"@\n"
) << _("container.get().") << (QStringList()
<< QLatin1String("Item")
<< QLatin1String("i"));
) << _("container.get().") << QStringList({ "Item", "i" });
QTest::newRow("template_7") << _(
"struct Test\n"
......@@ -656,9 +615,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"TemplateClass<Test> p(new Test);\n"
"@\n"
) << _("p->") << (QStringList()
<< QLatin1String("Test")
<< QLatin1String("i"));
) << _("p->") << QStringList({ "Test", "i" });
QTest::newRow("type_of_pointer_is_typedef") << _(
"typedef struct Foo\n"
......@@ -667,9 +624,7 @@ void CppToolsPlugin::test_completion_data()
"} Foo;\n"
"Foo *bar;\n"
"@\n"
) << _("bar->") << (QStringList()
<< QLatin1String("Foo")
<< QLatin1String("foo"));
) << _("bar->") << QStringList({ "Foo", "foo" });
QTest::newRow("instantiate_full_specialization") << _(
"template<typename T>\n"
......@@ -686,9 +641,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"Template<char> templateChar;\n"
"@\n"
) << _("templateChar.") << (QStringList()
<< QLatin1String("Template")
<< QLatin1String("templateChar_i"));
) << _("templateChar.") << QStringList({ "Template", "templateChar_i" });
QTest::newRow("template_as_base: base as template directly") << _(
"class Data { int dataMember; };\n"
......@@ -698,11 +651,7 @@ void CppToolsPlugin::test_completion_data()
" Other<Data> c;\n"
" @\n"
"}"
) << _("c.") << (QStringList()
<< QLatin1String("Data")
<< QLatin1String("dataMember")
<< QLatin1String("Other")
<< QLatin1String("otherMember"));
) << _("c.") << QStringList({ "Data", "dataMember", "Other", "otherMember" });
QTest::newRow("template_as_base: base as class template") << _(
"class Data { int dataMember; };\n"
......@@ -713,13 +662,8 @@ void CppToolsPlugin::test_completion_data()
" More<Data> c;\n"
" @\n"
"}"
) << _("c.") << (QStringList()
<< QLatin1String("Data")
<< QLatin1String("dataMember")
<< QLatin1String("Other")
<< QLatin1String("otherMember")
<< QLatin1String("More")
<< QLatin1String("moreMember"));
) << _("c.") << QStringList({ "Data", "dataMember", "Other", "otherMember", "More",
"moreMember" });
QTest::newRow("template_as_base: base as globally qualified class template") << _(
"class Data { int dataMember; };\n"
......@@ -730,13 +674,8 @@ void CppToolsPlugin::test_completion_data()
" More<Data> c;\n"
" @\n"
"}"
) << _("c.") << (QStringList()
<< QLatin1String("Data")
<< QLatin1String("dataMember")
<< QLatin1String("Other")
<< QLatin1String("otherMember")
<< QLatin1String("More")
<< QLatin1String("moreMember"));
) << _("c.") << QStringList({ "Data", "dataMember", "Other", "otherMember", "More",
"moreMember" });
QTest::newRow("template_as_base: base as namespace qualified class template") << _(
"class Data { int dataMember; };\n"
......@@ -749,13 +688,8 @@ void CppToolsPlugin::test_completion_data()
" More<Data> c;\n"
" @\n"
"}"
) << _("c.") << (QStringList()
<< QLatin1String("Data")
<< QLatin1String("dataMember")
<< QLatin1String("Other")
<< QLatin1String("otherMember")
<< QLatin1String("More")
<< QLatin1String("moreMember"));
) << _("c.") << QStringList({ "Data", "dataMember", "Other", "otherMember", "More",
"moreMember" });
QTest::newRow("template_as_base: base as nested template name") << _(
"class Data { int dataMember; };\n"
......@@ -768,11 +702,7 @@ void CppToolsPlugin::test_completion_data()
" Final<Data> c;\n"
" @\n"
"}"
) << _("c.") << (QStringList()
<< QLatin1String("Data")
<< QLatin1String("dataMember")
<< QLatin1String("Final")
<< QLatin1String("finalMember"));
) << _("c.") << QStringList({ "Data", "dataMember", "Final", "finalMember" });
QTest::newRow("template_as_base: base as nested template name in non-template") << _(
"class Data { int dataMember; };\n"
......@@ -785,11 +715,7 @@ void CppToolsPlugin::test_completion_data()
" Final c;\n"
" @\n"
"}"
) << _("c.") << (QStringList()
<< QLatin1String("Data")
<< QLatin1String("dataMember")
<< QLatin1String("Final")
<< QLatin1String("finalMember"));
) << _("c.") << QStringList({ "Data", "dataMember", "Final", "finalMember" });
QTest::newRow("template_as_base: base as template name in non-template") << _(
"class Data { int dataMember; };\n"
......@@ -802,13 +728,8 @@ void CppToolsPlugin::test_completion_data()
" Final c;\n"
" @\n"
"}"
) << _("c.") << (QStringList()
<< QLatin1String("Data")
<< QLatin1String("dataMember")
<< QLatin1String("Final")
<< QLatin1String("finalMember")
<< QLatin1String("Other")
<< QLatin1String("otherMember"));
) << _("c.") << QStringList({ "Data", "dataMember", "Final", "finalMember", "Other",
"otherMember" });
QTest::newRow("template_as_base: typedef not available in derived") << _(
"class Data { int dataMember; };\n"
......@@ -834,9 +755,7 @@ void CppToolsPlugin::test_completion_data()
" Derived<Data> d;\n"
" @\n"
"}\n"
) << _("d.f.") << (QStringList()
<< QLatin1String("Data")
<< QLatin1String("dataMember"));
) << _("d.f.") << QStringList({ "Data", "dataMember" });
QTest::newRow("use_global_identifier_as_base_class: derived as global and base as global") << _(
"struct Global\n"
......@@ -851,11 +770,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"Final c;\n"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("int_global")
<< QLatin1String("int_final")
<< QLatin1String("Final")
<< QLatin1String("Global"));
) << _("c.") << QStringList({ "int_global", "int_final", "Final", "Global" });
QTest::newRow("use_global_identifier_as_base_class: derived is inside namespace. "
"base as global") << _(
......@@ -874,11 +789,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"NS::Final c;\n"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("int_global")
<< QLatin1String("int_final")
<< QLatin1String("Final")
<< QLatin1String("Global"));
) << _("c.") << QStringList({ "int_global", "int_final", "Final", "Global" });
QTest::newRow("use_global_identifier_as_base_class: derived is enclosed by template. "
"base as global") << _(
......@@ -898,11 +809,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"Enclosing<int>::Final c;\n"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("int_global")
<< QLatin1String("int_final")
<< QLatin1String("Final")
<< QLatin1String("Global"));
) << _("c.") << QStringList({ "int_global", "int_final", "Final", "Global" });
QTest::newRow("base_class_has_name_the_same_as_derived: base class is derived class") << _(
"struct A : A\n"
......@@ -912,9 +819,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"A c;\n"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("int_a")
<< QLatin1String("A"));
) << _("c.") << QStringList({ "int_a", "A" });
QTest::newRow("base_class_has_name_the_same_as_derived: base class is derived class. "
"class is in namespace") << _(
......@@ -928,9 +833,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"NS::A c;\n"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("int_a")
<< QLatin1String("A"));
) << _("c.") << QStringList({ "int_a", "A" });
QTest::newRow("base_class_has_name_the_same_as_derived: base class is derived class. "
"class is in namespace. use scope operator for base class") << _(
......@@ -944,9 +847,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"NS::A c;\n"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("int_a")
<< QLatin1String("A"));
) << _("c.") << QStringList({ "int_a", "A" });
QTest::newRow("base_class_has_name_the_same_as_derived: base class has the same name as "
"derived but in different namespace") << _(
......@@ -967,10 +868,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"NS2::A c;\n"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("int_ns1_a")
<< QLatin1String("int_ns2_a")
<< QLatin1String("A"));
) << _("c.") << QStringList({ "int_ns1_a", "int_ns2_a", "A" });
QTest::newRow("base_class_has_name_the_same_as_derived: base class has the same name as "
"derived (in namespace) but is nested by different class") << _(
......@@ -991,10 +889,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"NS2::A c;\n"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("int_enclosing_a")
<< QLatin1String("int_ns2_a")
<< QLatin1String("A"));
) << _("c.") << QStringList({ "int_enclosing_a", "int_ns2_a", "A" });
QTest::newRow("base_class_has_name_the_same_as_derived: base class has the same name as "
"derived (nested) but is nested by different class") << _(
......@@ -1015,10 +910,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"EnclosingDerived::A c;\n"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("int_enclosing_base_a")
<< QLatin1String("int_enclosing_derived_a")
<< QLatin1String("A"));
) << _("c.") << QStringList({ "int_enclosing_base_a", "int_enclosing_derived_a", "A" });
QTest::newRow("base_class_has_name_the_same_as_derived: base class is derived class. "
"class is a template") << _(
......@@ -1030,9 +922,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"A<int> c;\n"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("int_a")
<< QLatin1String("A"));
) << _("c.") << QStringList({ "int_a", "A" });
QTest::newRow("cyclic_inheritance: direct cyclic inheritance") << _(
"struct B;\n"
......@@ -1041,11 +931,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"A c;\n"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("A")
<< QLatin1String("_a")
<< QLatin1String("B")
<< QLatin1String("_b"));
) << _("c.") << QStringList({ "A", "_a", "B", "_b" });
QTest::newRow("cyclic_inheritance: indirect cyclic inheritance") << _(
"struct C;\n"
......@@ -1055,13 +941,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"A c;\n"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("A")
<< QLatin1String("_a")
<< QLatin1String("B")
<< QLatin1String("_b")
<< QLatin1String("C")
<< QLatin1String("_c"));
) << _("c.") << QStringList({ "A", "_a", "B", "_b", "C", "_c" });
QTest::newRow("cyclic_inheritance: indirect cyclic inheritance") << _(
"struct B;\n"
......@@ -1071,13 +951,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"A c;\n"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("A")
<< QLatin1String("_a")
<< QLatin1String("B")
<< QLatin1String("_b")
<< QLatin1String("C")
<< QLatin1String("_c"));
) << _("c.") << QStringList({ "A", "_a", "B", "_b", "C", "_c" });
QTest::newRow("cyclic_inheritance: direct cyclic inheritance with templates") << _(
"template< typename T > struct C;\n"
......@@ -1093,12 +967,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"D<int, float> c;\n"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("D")
<< QLatin1String("_d_t")
<< QLatin1String("_d_s")
<< QLatin1String("C")
<< QLatin1String("_c_t"));
) << _("c.") << QStringList({ "D", "_d_t", "_d_s", "C", "_c_t" });
QTest::newRow("cyclic_inheritance: indirect cyclic inheritance with templates") << _(
"template< typename T > struct C;\n"
......@@ -1118,14 +987,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"D<int, float> c;\n"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("D")
<< QLatin1String("_d_t")
<< QLatin1String("_d_s")
<< QLatin1String("C")
<< QLatin1String("_c_t")
<< QLatin1String("B")
<< QLatin1String("_b_t"));
) << _("c.") << QStringList({ "D", "_d_t", "_d_s", "C", "_c_t", "B", "_b_t" });
QTest::newRow("cyclic_inheritance: direct cyclic inheritance with templates. "
"more complex situation") << _(
......@@ -1156,12 +1018,8 @@ void CppToolsPlugin::test_completion_data()
"\n"
"Class<int> c;\n"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("Class")
<< QLatin1String("ClassRecurse")
<< QLatin1String("class_t")
<< QLatin1String("class_recurse_s")
<< QLatin1String("class_recurse_t"));
) << _("c.") << QStringList({ "Class", "ClassRecurse", "class_t", "class_recurse_s",
"class_recurse_t" });
QTest::newRow("enclosing_template_class: nested class with enclosing template class") << _(
"template<typename T>\n"
......@@ -1173,9 +1031,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"Enclosing<int>::Nested c;"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("Nested")
<< QLatin1String("int_nested"));
) << _("c.") << QStringList({ "Nested", "int_nested" });
QTest::newRow("enclosing_template_class: nested template class with enclosing template "
"class") << _(
......@@ -1188,9 +1044,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"Enclosing<int>::Nested<int> c;"
"@\n"
) << _("c.") << (QStringList()
<< QLatin1String("Nested")
<< QLatin1String("int_nested"));
) << _("c.") << QStringList({ "Nested", "int_nested" });
QTest::newRow("instantiate_nested_class_when_enclosing_is_template") << _(
"struct Foo \n"
......@@ -1211,9 +1065,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"Enclosing<Foo> enclosing;\n"
"@\n"
) << _("enclosing.nested.nested_t.") << (QStringList()
<< QLatin1String("Foo")
<< QLatin1String("foo_i"));
) << _("enclosing.nested.nested_t.") << QStringList({ "Foo", "foo_i" });
QTest::newRow("instantiate_nested_of_nested_class_when_enclosing_is_template") << _(
"struct Foo \n"
......@@ -1238,9 +1090,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"Enclosing<Foo> enclosing;\n"
"@\n"
) << _("enclosing.nested.nestedNested.nestedNested_t.") << (QStringList()
<< QLatin1String("Foo")
<< QLatin1String("foo_i"));
) << _("enclosing.nested.nestedNested.nestedNested_t.") << QStringList({ "Foo", "foo_i" });
QTest::newRow("instantiate_template_with_default_argument_type") << _(
"struct Foo\n"
......@@ -1256,9 +1106,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"Template<> templateWithDefaultTypeOfArgument;\n"
"@\n"
) << _("templateWithDefaultTypeOfArgument.t.") << (QStringList()
<< QLatin1String("Foo")
<< QLatin1String("bar"));
) << _("templateWithDefaultTypeOfArgument.t.") << QStringList({ "Foo", "bar" });
QTest::newRow("instantiate_template_with_default_argument_type_as_template") << _(
"struct Foo\n"
......@@ -1279,9 +1127,7 @@ void CppToolsPlugin::test_completion_data()
"\n"
"Template<Foo> templateWithDefaultTypeOfArgument;\n"
"@\n"
) << _("templateWithDefaultTypeOfArgument.s.t.") << (QStringList()
<< QLatin1String("Foo")
<< QLatin1String("bar"));
) << _("templateWithDefaultTypeOfArgument.s.t.") << QStringList({ "Foo", "bar" });
QTest::newRow("typedef_of_pointer") << _(
"struct Foo { int bar; };\n"
......@@ -1291,9 +1137,7 @@ void CppToolsPlugin::test_completion_data()
" FooPtr ptr;\n"
" @\n"
"}"
) << _("ptr->") << (QStringList()
<< QLatin1String("Foo")
<< QLatin1String("bar"));
) << _("ptr->") << QStringList({ "Foo", "bar" });
QTest::newRow("typedef_of_pointer_inside_function") << _(
"struct Foo { int bar; };\n"
......@@ -1303,9 +1147,7 @@ void CppToolsPlugin::test_completion_data()
" FooPtr ptr;\n"
" @\n"
"}"
) << _("ptr->") << (QStringList()
<< QLatin1String("Foo")
<< QLatin1String("bar"));
) << _("ptr->") << QStringList({ "Foo", "bar" });
QTest::newRow("typedef_is_inside_function_before_declaration_block") << _(
"struct Foo { int bar; };\n"
......@@ -1317,9 +1159,7 @@ void CppToolsPlugin::test_completion_data()
" @\n"
" }"
"}"
) << _("ptr->") << (QStringList()
<< QLatin1String("Foo")
<< QLatin1String("bar"));
) << _("ptr->") << QStringList({ "Foo", "bar" });
QTest::newRow("resolve_complex_typedef_with_template") << _(
"template <typename T>\n"
......@@ -1342,10 +1182,7 @@ void CppToolsPlugin::test_completion_data()
" Template2<Foo> template2;\n"
" @\n"
"}\n"
) << _("template2.templateTypedef.") << (QStringList()
<< QLatin1String("Foo")
<< QLatin1String("bar")
<< QLatin1String("Template1"));
) << _("template2.templateTypedef.") << QStringList({ "Foo", "bar", "Template1" });
QTest::newRow("template_specialization_with_pointer") << _(
"template <typename T>\n"
......@@ -1360,9 +1197,7 @@ void CppToolsPlugin::test_completion_data()
"};\n"
"Template<int*> templ;\n"
"@\n"
) << _("templ.") << (QStringList()
<< QLatin1String("Template")
<< QLatin1String("pointer"));
) << _("templ.") << QStringList({ "Template", "pointer" });