Commit 67287417 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

CppEditor: Be more strict about quickfixes that were not triggered



in tests

Change-Id: I1f4b4c7a1f4068a83d385e74d75a482b5effdb0c
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent d2b5136a
......@@ -1406,16 +1406,7 @@ void CppEditorPlugin::test_quickfix_InsertVirtualMethods_data()
"public:\n"
" virtual int virtualFuncA() = 0;\n"
"};\n"
) << _(
"class BaseA {\n"
"public:\n"
" virtual int virtualFuncA();\n"
"};\n\n"
"class Derived : public Bas@eA {\n"
"public:\n"
" virtual int virtualFuncA() = 0;\n"
"};\n"
);
) << _();
// Check: One pure, one not
QTest::newRow("Some_Pure")
......
......@@ -215,7 +215,7 @@ QuickFixOperationTest::QuickFixOperationTest(const QList<QuickFixTestDocument::P
TextEditor::QuickFixOperations operations;
factory->match(quickFixInterface, operations);
if (operations.isEmpty()) {
qDebug() << "Quickfix was not triggered";
QVERIFY(testDocuments.first()->m_expectedSource.isEmpty());
return;
}
......@@ -1296,7 +1296,7 @@ void CppEditorPlugin::test_quickfix_data()
QTest::newRow("OptimizeForLoop_wrongInitializer")
<< CppQuickFixFactoryPtr(new OptimizeForLoop)
<< _("int i; void foo() {f@or (double a = 0; i < 3 + 5; ++i) {}}\n")
<< _("int i; void foo() {f@or (double a = 0; i < 3 + 5; ++i) {}}\n");
<< _();
// Check: No trigger when numeric
QTest::newRow("OptimizeForLoop_noTriggerNumeric1")
......@@ -1601,8 +1601,6 @@ void CppEditorPlugin::test_quickfix()
QFETCH(QByteArray, original);
QFETCH(QByteArray, expected);
if (expected.isEmpty())
expected = original;
QuickFixOperationTest(singleDocument(original, expected), factory.data());
}
......@@ -1900,11 +1898,9 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_notTriggeringWhenDefinitio
" void b@ar();\n"
"};\n"
"void Foo::bar() {}\n";
const QByteArray expected = original;
InsertDefFromDecl factory;
QuickFixOperationTest(singleDocument(original, expected), &factory, ProjectPart::HeaderPaths(),
1);
QuickFixOperationTest(singleDocument(original, ""), &factory, ProjectPart::HeaderPaths(), 1);
}
/// Find right implementation file.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment