Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C#: [TEST ONLY] Add test using the System.Threading.Lock type. #18348

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion csharp/ql/test/library-tests/statements/Block4.expected
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:10:21:10:24 | Main |
| statements.cs:11:21:11:24 | Main |
2 changes: 1 addition & 1 deletion csharp/ql/test/library-tests/statements/Break1.expected
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:146:21:146:29 | MainBreak | statements.cs:151:32:151:37 | break; |
| statements.cs:147:21:147:29 | MainBreak | statements.cs:152:32:152:37 | break; |
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:233:13:236:13 | checked {...} | statements.cs:234:13:236:13 | {...} |
| statements.cs:234:13:237:13 | checked {...} | statements.cs:235:13:237:13 | {...} |
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
| fixed.cs:3:7:3:11 | {...} | fixed.cs:3:7:3:11 | Fixed |
| statements.cs:7:11:7:15 | {...} | statements.cs:7:11:7:15 | Class |
| statements.cs:243:15:243:25 | {...} | statements.cs:243:15:243:25 | AccountLock |
| statements.cs:8:11:8:15 | {...} | statements.cs:8:11:8:15 | Class |
| statements.cs:244:15:244:25 | {...} | statements.cs:244:15:244:25 | AccountLock |
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:156:21:156:32 | MainContinue | statements.cs:160:46:160:54 | continue; |
| statements.cs:157:21:157:32 | MainContinue | statements.cs:161:46:161:54 | continue; |
2 changes: 1 addition & 1 deletion csharp/ql/test/library-tests/statements/Do2.expected
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:120:21:120:26 | MainDo | statements.cs:123:13:127:32 | do ... while (...); |
| statements.cs:121:21:121:26 | MainDo | statements.cs:124:13:128:32 | do ... while (...); |
2 changes: 1 addition & 1 deletion csharp/ql/test/library-tests/statements/Expr1.expected
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:47:21:47:28 | MainExpr |
| statements.cs:48:21:48:28 | MainExpr |
2 changes: 1 addition & 1 deletion csharp/ql/test/library-tests/statements/For2.expected
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:132:13:135:13 | for (...;...;...) ... | statements.cs:132:29:132:43 | ... < ... |
| statements.cs:133:13:136:13 | for (...;...;...) ... | statements.cs:133:29:133:43 | ... < ... |
2 changes: 1 addition & 1 deletion csharp/ql/test/library-tests/statements/For3.expected
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:132:13:135:13 | for (...;...;...) ... | statements.cs:132:46:132:48 | ...++ |
| statements.cs:133:13:136:13 | for (...;...;...) ... | statements.cs:133:46:133:48 | ...++ |
2 changes: 1 addition & 1 deletion csharp/ql/test/library-tests/statements/For4.expected
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:132:13:135:13 | for (...;...;...) ... | statements.cs:132:22:132:26 | Int32 i = ... |
| statements.cs:133:13:136:13 | for (...;...;...) ... | statements.cs:133:22:133:26 | Int32 i = ... |
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:138:21:138:31 | MainForeach |
| statements.cs:139:21:139:31 | MainForeach |
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:140:13:143:13 | foreach (... ... in ...) ... | statements.cs:140:29:140:29 | s |
| statements.cs:141:13:144:13 | foreach (... ... in ...) ... | statements.cs:141:29:141:29 | s |
2 changes: 1 addition & 1 deletion csharp/ql/test/library-tests/statements/Goto1.expected
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:165:21:165:28 | MainGoto | statements.cs:168:13:168:23 | goto ...; |
| statements.cs:166:21:166:28 | MainGoto | statements.cs:169:13:169:23 | goto ...; |
2 changes: 1 addition & 1 deletion csharp/ql/test/library-tests/statements/Goto2.expected
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:165:21:165:28 | MainGoto | statements.cs:170:41:170:50 | goto ...; |
| statements.cs:166:21:166:28 | MainGoto | statements.cs:171:37:171:46 | goto ...; |
2 changes: 1 addition & 1 deletion csharp/ql/test/library-tests/statements/If2.expected
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:58:13:65:13 | if (...) ... | statements.cs:63:13:65:13 | {...} |
| statements.cs:59:13:66:13 | if (...) ... | statements.cs:64:13:66:13 | {...} |
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:272:21:272:31 | MainLabeled | statements.cs:275:13:275:17 | Label: |
| statements.cs:273:21:273:31 | MainLabeled | statements.cs:276:9:276:13 | Label: |
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:40:21:40:38 | MainLocalConstDecl | statements.cs:42:13:42:40 | const ... ...; | statements.cs:42:25:42:39 | Single pi = ... | 3.1415927 |
| statements.cs:41:21:41:38 | MainLocalConstDecl | statements.cs:43:13:43:40 | const ... ...; | statements.cs:43:25:43:39 | Single pi = ... | 3.1415927 |
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:40:21:40:38 | MainLocalConstDecl | statements.cs:43:13:43:33 | const ... ...; | statements.cs:43:23:43:32 | Int32 r = ... |
| statements.cs:41:21:41:38 | MainLocalConstDecl | statements.cs:44:13:44:33 | const ... ...; | statements.cs:44:23:44:32 | Int32 r = ... |
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:40:21:40:38 | MainLocalConstDecl | statements.cs:43:13:43:33 | const ... ...; | statements.cs:43:23:43:32 | Int32 r = ... |
| statements.cs:41:21:41:38 | MainLocalConstDecl | statements.cs:44:13:44:33 | const ... ...; | statements.cs:44:23:44:32 | Int32 r = ... |
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:30:21:30:36 | MainLocalVarDecl | statements.cs:32:13:32:18 | ... ...; | statements.cs:32:17:32:17 | Int32 a |
| statements.cs:31:21:31:36 | MainLocalVarDecl | statements.cs:33:13:33:18 | ... ...; | statements.cs:33:17:33:17 | Int32 a |
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:30:21:30:36 | MainLocalVarDecl | statements.cs:33:13:33:29 | ... ...; | statements.cs:33:17:33:21 | Int32 b = ... |
| statements.cs:31:21:31:36 | MainLocalVarDecl | statements.cs:34:13:34:29 | ... ...; | statements.cs:34:17:34:21 | Int32 b = ... |
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:30:21:30:36 | MainLocalVarDecl | statements.cs:33:13:33:29 | ... ...; | statements.cs:33:17:33:21 | Int32 b = ... | statements.cs:33:24:33:28 | Int32 c = ... |
| statements.cs:31:21:31:36 | MainLocalVarDecl | statements.cs:34:13:34:29 | ... ...; | statements.cs:34:17:34:21 | Int32 b = ... | statements.cs:34:24:34:28 | Int32 c = ... |
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:30:21:30:36 | MainLocalVarDecl | statements.cs:32:13:32:18 | ... ...; | statements.cs:32:17:32:17 | Int32 a |
| statements.cs:31:21:31:36 | MainLocalVarDecl | statements.cs:33:13:33:18 | ... ...; | statements.cs:33:17:33:17 | Int32 a |
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:30:21:30:36 | MainLocalVarDecl | statements.cs:37:13:37:27 | ... ...; | statements.cs:37:17:37:26 | String y = ... |
| statements.cs:31:21:31:36 | MainLocalVarDecl | statements.cs:38:13:38:27 | ... ...; | statements.cs:38:17:38:26 | String y = ... |
2 changes: 1 addition & 1 deletion csharp/ql/test/library-tests/statements/Lock2.expected
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| statements.cs:248:17:255:17 | lock (...) {...} | statements.cs:248:23:248:26 | this access | statements.cs:249:17:255:17 | {...} |
| statements.cs:249:17:256:17 | lock (...) {...} | statements.cs:249:23:249:26 | this access | statements.cs:250:17:256:17 | {...} |
1 change: 1 addition & 0 deletions csharp/ql/test/library-tests/statements/Lock3.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| statements.cs:285:13:288:13 | lock (...) {...} | statements.cs:285:19:285:28 | access to field lockObject | Lock | statements.cs:286:13:288:13 | {...} |
8 changes: 8 additions & 0 deletions csharp/ql/test/library-tests/statements/Lock3.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import csharp

from Method m, LockStmt ls, Expr lockExpr
where
ls.getEnclosingCallable() = m and
m.getName() = "LockMethod" and
lockExpr = ls.getExpr()
select ls, lockExpr, lockExpr.getType().toString(), ls.getBlock()
Loading
Loading