Skip to content

Commit 53b2eac

Browse files
committed
C#: Remove (symmetric) duplicates from the test output.
1 parent 38f04e5 commit 53b2eac

File tree

2 files changed

+10
-52
lines changed

2 files changed

+10
-52
lines changed

csharp/ql/test/library-tests/structuralcomparison/structuralComparison.expected

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,13 @@ same
22
| StructuralComparison.cs:15:18:15:18 | access to field x | StructuralComparison.cs:16:18:16:18 | access to field x |
33
| StructuralComparison.cs:15:18:15:22 | ... + ... | StructuralComparison.cs:16:18:16:22 | ... + ... |
44
| StructuralComparison.cs:15:22:15:22 | access to field y | StructuralComparison.cs:16:22:16:22 | access to field y |
5-
| StructuralComparison.cs:16:18:16:18 | access to field x | StructuralComparison.cs:15:18:15:18 | access to field x |
6-
| StructuralComparison.cs:16:18:16:22 | ... + ... | StructuralComparison.cs:15:18:15:22 | ... + ... |
7-
| StructuralComparison.cs:16:22:16:22 | access to field y | StructuralComparison.cs:15:22:15:22 | access to field y |
85
| StructuralComparison.cs:21:18:21:22 | call to method M1 | StructuralComparison.cs:22:18:22:22 | call to method M1 |
96
| StructuralComparison.cs:21:21:21:21 | access to field x | StructuralComparison.cs:22:21:22:21 | access to field x |
107
| StructuralComparison.cs:21:21:21:21 | access to field x | StructuralComparison.cs:25:21:25:21 | access to field x |
118
| StructuralComparison.cs:21:21:21:21 | access to field x | StructuralComparison.cs:25:32:25:32 | access to field x |
129
| StructuralComparison.cs:21:21:21:21 | access to field x | StructuralComparison.cs:26:12:26:12 | access to field x |
1310
| StructuralComparison.cs:21:21:21:21 | access to field x | StructuralComparison.cs:27:15:27:15 | access to field x |
1411
| StructuralComparison.cs:21:21:21:21 | access to field x | StructuralComparison.cs:28:15:28:15 | access to field x |
15-
| StructuralComparison.cs:22:18:22:22 | call to method M1 | StructuralComparison.cs:21:18:21:22 | call to method M1 |
16-
| StructuralComparison.cs:22:21:22:21 | access to field x | StructuralComparison.cs:21:21:21:21 | access to field x |
1712
| StructuralComparison.cs:22:21:22:21 | access to field x | StructuralComparison.cs:25:21:25:21 | access to field x |
1813
| StructuralComparison.cs:22:21:22:21 | access to field x | StructuralComparison.cs:25:32:25:32 | access to field x |
1914
| StructuralComparison.cs:22:21:22:21 | access to field x | StructuralComparison.cs:26:12:26:12 | access to field x |
@@ -26,81 +21,35 @@ same
2621
| StructuralComparison.cs:23:21:23:21 | access to field y | StructuralComparison.cs:28:12:28:12 | access to field y |
2722
| StructuralComparison.cs:25:18:25:25 | call to method M2 | StructuralComparison.cs:25:29:25:36 | call to method M2 |
2823
| StructuralComparison.cs:25:18:25:25 | call to method M2 | StructuralComparison.cs:26:9:26:16 | call to method M2 |
29-
| StructuralComparison.cs:25:21:25:21 | access to field x | StructuralComparison.cs:21:21:21:21 | access to field x |
30-
| StructuralComparison.cs:25:21:25:21 | access to field x | StructuralComparison.cs:22:21:22:21 | access to field x |
3124
| StructuralComparison.cs:25:21:25:21 | access to field x | StructuralComparison.cs:25:32:25:32 | access to field x |
3225
| StructuralComparison.cs:25:21:25:21 | access to field x | StructuralComparison.cs:26:12:26:12 | access to field x |
3326
| StructuralComparison.cs:25:21:25:21 | access to field x | StructuralComparison.cs:27:15:27:15 | access to field x |
3427
| StructuralComparison.cs:25:21:25:21 | access to field x | StructuralComparison.cs:28:15:28:15 | access to field x |
35-
| StructuralComparison.cs:25:24:25:24 | access to field y | StructuralComparison.cs:23:21:23:21 | access to field y |
3628
| StructuralComparison.cs:25:24:25:24 | access to field y | StructuralComparison.cs:25:35:25:35 | access to field y |
3729
| StructuralComparison.cs:25:24:25:24 | access to field y | StructuralComparison.cs:26:15:26:15 | access to field y |
3830
| StructuralComparison.cs:25:24:25:24 | access to field y | StructuralComparison.cs:27:12:27:12 | access to field y |
3931
| StructuralComparison.cs:25:24:25:24 | access to field y | StructuralComparison.cs:28:12:28:12 | access to field y |
40-
| StructuralComparison.cs:25:29:25:36 | call to method M2 | StructuralComparison.cs:25:18:25:25 | call to method M2 |
4132
| StructuralComparison.cs:25:29:25:36 | call to method M2 | StructuralComparison.cs:26:9:26:16 | call to method M2 |
42-
| StructuralComparison.cs:25:32:25:32 | access to field x | StructuralComparison.cs:21:21:21:21 | access to field x |
43-
| StructuralComparison.cs:25:32:25:32 | access to field x | StructuralComparison.cs:22:21:22:21 | access to field x |
44-
| StructuralComparison.cs:25:32:25:32 | access to field x | StructuralComparison.cs:25:21:25:21 | access to field x |
4533
| StructuralComparison.cs:25:32:25:32 | access to field x | StructuralComparison.cs:26:12:26:12 | access to field x |
4634
| StructuralComparison.cs:25:32:25:32 | access to field x | StructuralComparison.cs:27:15:27:15 | access to field x |
4735
| StructuralComparison.cs:25:32:25:32 | access to field x | StructuralComparison.cs:28:15:28:15 | access to field x |
48-
| StructuralComparison.cs:25:35:25:35 | access to field y | StructuralComparison.cs:23:21:23:21 | access to field y |
49-
| StructuralComparison.cs:25:35:25:35 | access to field y | StructuralComparison.cs:25:24:25:24 | access to field y |
5036
| StructuralComparison.cs:25:35:25:35 | access to field y | StructuralComparison.cs:26:15:26:15 | access to field y |
5137
| StructuralComparison.cs:25:35:25:35 | access to field y | StructuralComparison.cs:27:12:27:12 | access to field y |
5238
| StructuralComparison.cs:25:35:25:35 | access to field y | StructuralComparison.cs:28:12:28:12 | access to field y |
53-
| StructuralComparison.cs:26:9:26:16 | call to method M2 | StructuralComparison.cs:25:18:25:25 | call to method M2 |
54-
| StructuralComparison.cs:26:9:26:16 | call to method M2 | StructuralComparison.cs:25:29:25:36 | call to method M2 |
55-
| StructuralComparison.cs:26:12:26:12 | access to field x | StructuralComparison.cs:21:21:21:21 | access to field x |
56-
| StructuralComparison.cs:26:12:26:12 | access to field x | StructuralComparison.cs:22:21:22:21 | access to field x |
57-
| StructuralComparison.cs:26:12:26:12 | access to field x | StructuralComparison.cs:25:21:25:21 | access to field x |
58-
| StructuralComparison.cs:26:12:26:12 | access to field x | StructuralComparison.cs:25:32:25:32 | access to field x |
5939
| StructuralComparison.cs:26:12:26:12 | access to field x | StructuralComparison.cs:27:15:27:15 | access to field x |
6040
| StructuralComparison.cs:26:12:26:12 | access to field x | StructuralComparison.cs:28:15:28:15 | access to field x |
61-
| StructuralComparison.cs:26:15:26:15 | access to field y | StructuralComparison.cs:23:21:23:21 | access to field y |
62-
| StructuralComparison.cs:26:15:26:15 | access to field y | StructuralComparison.cs:25:24:25:24 | access to field y |
63-
| StructuralComparison.cs:26:15:26:15 | access to field y | StructuralComparison.cs:25:35:25:35 | access to field y |
6441
| StructuralComparison.cs:26:15:26:15 | access to field y | StructuralComparison.cs:27:12:27:12 | access to field y |
6542
| StructuralComparison.cs:26:15:26:15 | access to field y | StructuralComparison.cs:28:12:28:12 | access to field y |
6643
| StructuralComparison.cs:27:9:27:16 | call to method M2 | StructuralComparison.cs:28:9:28:16 | call to method M2 |
6744
| StructuralComparison.cs:27:9:27:17 | ...; | StructuralComparison.cs:28:9:28:17 | ...; |
68-
| StructuralComparison.cs:27:12:27:12 | access to field y | StructuralComparison.cs:23:21:23:21 | access to field y |
69-
| StructuralComparison.cs:27:12:27:12 | access to field y | StructuralComparison.cs:25:24:25:24 | access to field y |
70-
| StructuralComparison.cs:27:12:27:12 | access to field y | StructuralComparison.cs:25:35:25:35 | access to field y |
71-
| StructuralComparison.cs:27:12:27:12 | access to field y | StructuralComparison.cs:26:15:26:15 | access to field y |
7245
| StructuralComparison.cs:27:12:27:12 | access to field y | StructuralComparison.cs:28:12:28:12 | access to field y |
73-
| StructuralComparison.cs:27:15:27:15 | access to field x | StructuralComparison.cs:21:21:21:21 | access to field x |
74-
| StructuralComparison.cs:27:15:27:15 | access to field x | StructuralComparison.cs:22:21:22:21 | access to field x |
75-
| StructuralComparison.cs:27:15:27:15 | access to field x | StructuralComparison.cs:25:21:25:21 | access to field x |
76-
| StructuralComparison.cs:27:15:27:15 | access to field x | StructuralComparison.cs:25:32:25:32 | access to field x |
77-
| StructuralComparison.cs:27:15:27:15 | access to field x | StructuralComparison.cs:26:12:26:12 | access to field x |
7846
| StructuralComparison.cs:27:15:27:15 | access to field x | StructuralComparison.cs:28:15:28:15 | access to field x |
79-
| StructuralComparison.cs:28:9:28:16 | call to method M2 | StructuralComparison.cs:27:9:27:16 | call to method M2 |
80-
| StructuralComparison.cs:28:9:28:17 | ...; | StructuralComparison.cs:27:9:27:17 | ...; |
81-
| StructuralComparison.cs:28:12:28:12 | access to field y | StructuralComparison.cs:23:21:23:21 | access to field y |
82-
| StructuralComparison.cs:28:12:28:12 | access to field y | StructuralComparison.cs:25:24:25:24 | access to field y |
83-
| StructuralComparison.cs:28:12:28:12 | access to field y | StructuralComparison.cs:25:35:25:35 | access to field y |
84-
| StructuralComparison.cs:28:12:28:12 | access to field y | StructuralComparison.cs:26:15:26:15 | access to field y |
85-
| StructuralComparison.cs:28:12:28:12 | access to field y | StructuralComparison.cs:27:12:27:12 | access to field y |
86-
| StructuralComparison.cs:28:15:28:15 | access to field x | StructuralComparison.cs:21:21:21:21 | access to field x |
87-
| StructuralComparison.cs:28:15:28:15 | access to field x | StructuralComparison.cs:22:21:22:21 | access to field x |
88-
| StructuralComparison.cs:28:15:28:15 | access to field x | StructuralComparison.cs:25:21:25:21 | access to field x |
89-
| StructuralComparison.cs:28:15:28:15 | access to field x | StructuralComparison.cs:25:32:25:32 | access to field x |
90-
| StructuralComparison.cs:28:15:28:15 | access to field x | StructuralComparison.cs:26:12:26:12 | access to field x |
91-
| StructuralComparison.cs:28:15:28:15 | access to field x | StructuralComparison.cs:27:15:27:15 | access to field x |
9247
| StructuralComparison.cs:42:18:42:27 | access to field Field | StructuralComparison.cs:43:18:43:22 | access to field Field |
9348
| StructuralComparison.cs:42:18:42:27 | access to field Field | StructuralComparison.cs:44:18:44:27 | access to field Field |
94-
| StructuralComparison.cs:43:18:43:22 | access to field Field | StructuralComparison.cs:42:18:42:27 | access to field Field |
9549
| StructuralComparison.cs:43:18:43:22 | access to field Field | StructuralComparison.cs:44:18:44:27 | access to field Field |
96-
| StructuralComparison.cs:44:18:44:27 | access to field Field | StructuralComparison.cs:42:18:42:27 | access to field Field |
97-
| StructuralComparison.cs:44:18:44:27 | access to field Field | StructuralComparison.cs:43:18:43:22 | access to field Field |
9850
| StructuralComparison.cs:49:18:49:26 | access to property Prop | StructuralComparison.cs:50:18:50:21 | access to property Prop |
9951
| StructuralComparison.cs:49:18:49:26 | access to property Prop | StructuralComparison.cs:51:18:51:26 | access to property Prop |
100-
| StructuralComparison.cs:50:18:50:21 | access to property Prop | StructuralComparison.cs:49:18:49:26 | access to property Prop |
10152
| StructuralComparison.cs:50:18:50:21 | access to property Prop | StructuralComparison.cs:51:18:51:26 | access to property Prop |
102-
| StructuralComparison.cs:51:18:51:26 | access to property Prop | StructuralComparison.cs:49:18:49:26 | access to property Prop |
103-
| StructuralComparison.cs:51:18:51:26 | access to property Prop | StructuralComparison.cs:50:18:50:21 | access to property Prop |
10453
gvn
10554
| StructuralComparison.cs:5:26:5:26 | access to field x | (kind:Expr(16),true,x) |
10655
| StructuralComparison.cs:5:26:5:26 | this access | (kind:Expr(12)) |

csharp/ql/test/library-tests/structuralcomparison/structuralComparison.ql

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,16 @@ private class StructuralComparisonTest extends StructuralComparisonConfiguration
1919
}
2020

2121
query predicate same(ControlFlowElement e1, ControlFlowElement e2) {
22-
exists(StructuralComparisonTest sct | sct.same(e1, e2))
22+
exists(StructuralComparisonTest sct, Location l1, Location l2 |
23+
sct.same(e1, e2) and
24+
l1 = e1.getLocation() and
25+
l2 = e2.getLocation() and
26+
(
27+
l1.getStartLine() < l2.getStartLine()
28+
or
29+
l1.getStartLine() = l2.getStartLine() and l1.getStartColumn() < l2.getStartColumn()
30+
)
31+
)
2332
}
2433

2534
query predicate gvn(ControlFlowElement e, Gvn gvn) { gvn = toGvn(e) and e.fromSource() }

0 commit comments

Comments
 (0)