From e241444ba3c8a6d3e6bcf2b8188a290f13bb3881 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Mon, 28 Sep 2015 08:42:14 +0200 Subject: [PATCH] C++: Comment out a flaky test The test relied on logic that was reverted with change 915f68deac95bf17bd97d1a2644264afb0b86f0b. LookupScopePrivate::findSpecialization() gets a "TemplateNameIdTable &specializations" with a non-deterministic order. Without the extra logic, the very first entry will be chosen as the found specialization. The non-deterministic order comes from the TemplateNameId::Compare, which calls std::lexicographical_compare() with the template arguments, which are FullySpecifiedTypes. The result of FullySpecifiedType::operator<() might depend on a pointer comparison. Change-Id: I8d69d1bb5831145b1c21a5ea848c0043f17ec415 Reviewed-by: Christian Stenger --- src/plugins/cpptools/cppcompletion_test.cpp | 31 ++++++++++----------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index 7a6dce2a3a6..d57742ca317 100644 --- a/src/plugins/cpptools/cppcompletion_test.cpp +++ b/src/plugins/cpptools/cppcompletion_test.cpp @@ -333,7 +333,6 @@ void CppToolsPlugin::test_completion() QEXPECT_FAIL("template_specialization_with_reference", "test of reverted change", Abort); QEXPECT_FAIL("specialization_multiple_arguments", "test of reverted change", Abort); QEXPECT_FAIL("specialization_with_default_value", "test of reverted change", Abort); - QEXPECT_FAIL("partial_specialization_with_pointer", "test of reverted change", Abort); QEXPECT_FAIL("enum_in_function_in_struct_in_function", "QTCREATORBUG-13757", Abort); QEXPECT_FAIL("enum_in_function_in_struct_in_function_cxx11", "QTCREATORBUG-13757", Abort); QEXPECT_FAIL("enum_in_function_in_struct_in_function_anon", "QTCREATORBUG-13757", Abort); @@ -2704,21 +2703,21 @@ void CppToolsPlugin::test_completion_data() << QLatin1String("i") << QLatin1String("s")); - QTest::newRow("partial_specialization_with_pointer") << _( - "struct b {};\n" - "struct a : b {};\n" - "template struct s { float f; };\n" - "template struct s { int i; };\n" - "template struct s { char j; };\n" - "\n" - "void f()\n" - "{\n" - " s var;\n" - " @\n" - "}\n" - ) << _("var.") << (QStringList() - << QLatin1String("j") - << QLatin1String("s")); +// QTest::newRow("partial_specialization_with_pointer") << _( +// "struct b {};\n" +// "struct a : b {};\n" +// "template struct s { float f; };\n" +// "template struct s { int i; };\n" +// "template struct s { char j; };\n" +// "\n" +// "void f()\n" +// "{\n" +// " s var;\n" +// " @\n" +// "}\n" +// ) << _("var.") << (QStringList() +// << QLatin1String("j") +// << QLatin1String("s")); QTest::newRow("partial_specialization_templated_argument") << _( "template struct t {};\n"