diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2020-11-04 14:13:16 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2020-11-04 13:24:33 +0000 |
commit | de1e12f3af483ab2c4014eb6230c83ddb1c3223d (patch) | |
tree | 50b1cdc591ea95c6141c2fa90f767de415d27800 /tests | |
parent | a88266798f7c317ed28f6ace4fe297ab8061dddc (diff) |
CPlusPlus: Correctly categorize post-increment and -decrement accesses
Change-Id: Id21c13ea58f6747c226d91aff2b00c3409faa880
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/cplusplus/findusages/tst_findusages.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/auto/cplusplus/findusages/tst_findusages.cpp b/tests/auto/cplusplus/findusages/tst_findusages.cpp index bb91c3a18f..b7f905433c 100644 --- a/tests/auto/cplusplus/findusages/tst_findusages.cpp +++ b/tests/auto/cplusplus/findusages/tst_findusages.cpp @@ -2086,6 +2086,8 @@ int main() } if (S::value) {} if (S::value = 0) {} + ++S::value; + S::value--; } )"; @@ -2111,7 +2113,7 @@ int main() // Access to struct member FindUsages find(src, doc, snapshot); find(sv); - QCOMPARE(find.usages().size(), 23); + QCOMPARE(find.usages().size(), 25); QCOMPARE(find.usages().at(0).type, Usage::Type::Read); QCOMPARE(find.usages().at(1).type, Usage::Type::Declaration); QCOMPARE(find.usages().at(2).type, Usage::Type::WritableRef); @@ -2135,6 +2137,8 @@ int main() QCOMPARE(find.usages().at(20).type, Usage::Type::Write); QCOMPARE(find.usages().at(21).type, Usage::Type::Read); QCOMPARE(find.usages().at(22).type, Usage::Type::Write); + QCOMPARE(find.usages().at(23).type, Usage::Type::Write); + QCOMPARE(find.usages().at(24).type, Usage::Type::Write); Declaration * const sv2 = structS->memberAt(2)->asDeclaration(); QVERIFY(sv2); @@ -2217,7 +2221,7 @@ int main() // Usages of struct type find(structS); - QCOMPARE(find.usages().size(), 10); + QCOMPARE(find.usages().size(), 12); QCOMPARE(find.usages().at(0).type, Usage::Type::Declaration); QCOMPARE(find.usages().at(1).type, Usage::Type::Other); QCOMPARE(find.usages().at(2).type, Usage::Type::Other); @@ -2231,6 +2235,8 @@ int main() QCOMPARE(find.usages().at(7).type, Usage::Type::Write); QCOMPARE(find.usages().at(8).type, Usage::Type::Read); QCOMPARE(find.usages().at(9).type, Usage::Type::Write); + QCOMPARE(find.usages().at(10).type, Usage::Type::Write); + QCOMPARE(find.usages().at(11).type, Usage::Type::Write); } QTEST_APPLESS_MAIN(tst_FindUsages) |