diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2020-11-04 13:02:01 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2020-11-04 13:02:52 +0000 |
commit | a88266798f7c317ed28f6ace4fe297ab8061dddc (patch) | |
tree | 7bfa854132e128ccee06ce7ebe1bf8c04d075b49 /tests | |
parent | cf6757406d6a0c012cdaadcd8706ae14a948b200 (diff) |
CPlusPlus: Differentiate declarations with an initializer
... from those without one, and display the former like write accesses.
Task-number: QTCREATORBUG-24894
Change-Id: I5e2d83b2a3ec4735054441c346687f97eeb039fb
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/cplusplus/findusages/tst_findusages.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/auto/cplusplus/findusages/tst_findusages.cpp b/tests/auto/cplusplus/findusages/tst_findusages.cpp index 214aa186c7..bb91c3a18f 100644 --- a/tests/auto/cplusplus/findusages/tst_findusages.cpp +++ b/tests/auto/cplusplus/findusages/tst_findusages.cpp @@ -367,7 +367,7 @@ void tst_FindUsages::staticVariables() findUsages(d); QCOMPARE(findUsages.usages().size(), 5); QCOMPARE(findUsages.usages().at(0).type, Usage::Type::Declaration); - QCOMPARE(findUsages.usages().at(1).type, Usage::Type::Declaration); + QCOMPARE(findUsages.usages().at(1).type, Usage::Type::Initialization); QCOMPARE(findUsages.usages().at(2).type, Usage::Type::Write); QCOMPARE(findUsages.usages().at(3).type, Usage::Type::Write); QCOMPARE(findUsages.usages().at(4).type, Usage::Type::Write); @@ -481,7 +481,7 @@ struct Struct{ find(variableFoo); QCOMPARE(find.usages().size(), 2); - QCOMPARE(find.usages()[0].type, Usage::Type::Declaration); + QCOMPARE(find.usages()[0].type, Usage::Type::Initialization); QCOMPARE(find.usages()[0].line, 5); QCOMPARE(find.usages()[0].col, 12); @@ -1652,7 +1652,7 @@ void tst_FindUsages::templateSpecialization_with_IntArgument() find(sv[1]); QCOMPARE(find.usages().size(), 2); - QCOMPARE(find.usages()[0].type, Usage::Type::Declaration); + QCOMPARE(find.usages()[0].type, Usage::Type::Initialization); QCOMPARE(find.usages()[0].line, 2); QCOMPARE(find.usages()[0].col, 15); QCOMPARE(find.usages()[1].type, Usage::Type::Read); @@ -1662,7 +1662,7 @@ void tst_FindUsages::templateSpecialization_with_IntArgument() find(sv[2]); QCOMPARE(find.usages().size(), 3); - QCOMPARE(find.usages()[0].type, Usage::Type::Declaration); + QCOMPARE(find.usages()[0].type, Usage::Type::Initialization); QCOMPARE(find.usages()[0].line, 3); QCOMPARE(find.usages()[0].col, 15); QCOMPARE(find.usages()[1].type, Usage::Type::Write); @@ -1731,7 +1731,7 @@ void tst_FindUsages::templateSpecialization_with_BoolArgument() find(sv[0]); QCOMPARE(find.usages().size(), 2); - QCOMPARE(find.usages()[0].type, Usage::Type::Declaration); + QCOMPARE(find.usages()[0].type, Usage::Type::Initialization); QCOMPARE(find.usages()[0].line, 1); QCOMPARE(find.usages()[0].col, 15); QCOMPARE(find.usages()[1].type, Usage::Type::Read); @@ -1741,7 +1741,7 @@ void tst_FindUsages::templateSpecialization_with_BoolArgument() find(sv[1]); QCOMPARE(find.usages().size(), 2); - QCOMPARE(find.usages()[0].type, Usage::Type::Declaration); + QCOMPARE(find.usages()[0].type, Usage::Type::Initialization); QCOMPARE(find.usages()[0].line, 2); QCOMPARE(find.usages()[0].col, 15); QCOMPARE(find.usages()[1].type, Usage::Type::Read); @@ -1807,7 +1807,7 @@ void tst_FindUsages::templatePartialSpecialization() find(sv[0]); QCOMPARE(find.usages().size(), 2); - QCOMPARE(find.usages()[0].type, Usage::Type::Declaration); + QCOMPARE(find.usages()[0].type, Usage::Type::Initialization); QCOMPARE(find.usages()[0].line, 1); QCOMPARE(find.usages()[0].col, 15); QCOMPARE(find.usages()[1].type, Usage::Type::Read); @@ -1817,7 +1817,7 @@ void tst_FindUsages::templatePartialSpecialization() find(sv[1]); QCOMPARE(find.usages().size(), 2); - QCOMPARE(find.usages()[0].type, Usage::Type::Declaration); + QCOMPARE(find.usages()[0].type, Usage::Type::Initialization); QCOMPARE(find.usages()[0].line, 2); QCOMPARE(find.usages()[0].col, 15); QCOMPARE(find.usages()[1].type, Usage::Type::Read); @@ -1876,17 +1876,17 @@ int main() find(sv[0]); QCOMPARE(find.usages().size(), 2); - QCOMPARE(find.usages().at(0).type, Usage::Type::Declaration); + QCOMPARE(find.usages().at(0).type, Usage::Type::Initialization); QCOMPARE(find.usages().at(1).type, Usage::Type::Read); find(sv[1]); QCOMPARE(find.usages().size(), 2); - QCOMPARE(find.usages().at(0).type, Usage::Type::Declaration); + QCOMPARE(find.usages().at(0).type, Usage::Type::Initialization); QCOMPARE(find.usages().at(1).type, Usage::Type::Read); find(sv[2]); QCOMPARE(find.usages().size(), 2); - QCOMPARE(find.usages().at(0).type, Usage::Type::Declaration); + QCOMPARE(find.usages().at(0).type, Usage::Type::Initialization); QCOMPARE(find.usages().at(1).type, Usage::Type::Read); } @@ -1926,7 +1926,7 @@ int main(){ FindUsages find(src, doc, snapshot); find(sv); QCOMPARE(find.usages().size(), 2); - QCOMPARE(find.usages().at(0).type, Usage::Type::Declaration); + QCOMPARE(find.usages().at(0).type, Usage::Type::Initialization); QCOMPARE(find.usages().at(1).type, Usage::Type::Read); } @@ -2159,7 +2159,7 @@ int main() QCOMPARE(p->name()->identifier()->chars(), "p"); find(p); QCOMPARE(find.usages().size(), 10); - QCOMPARE(find.usages().at(0).type, Usage::Type::Declaration); + QCOMPARE(find.usages().at(0).type, Usage::Type::Initialization); QCOMPARE(find.usages().at(1).type, Usage::Type::Write); QCOMPARE(find.usages().at(2).type, Usage::Type::Write); QCOMPARE(find.usages().at(3).type, Usage::Type::WritableRef); |