Skip to content

Commit 9e8867a

Browse files
committed
Swift: update enum dataflow test with more cases
1 parent 62d2f23 commit 9e8867a

File tree

3 files changed

+268
-191
lines changed

3 files changed

+268
-191
lines changed

swift/ql/test/library-tests/dataflow/dataflow/DataFlow.expected

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ edges
103103
| test.swift:225:14:225:21 | call to source() : | test.swift:235:13:235:15 | .source_value |
104104
| test.swift:225:14:225:21 | call to source() : | test.swift:238:13:238:15 | .source_value |
105105
| test.swift:259:12:259:19 | call to source() : | test.swift:263:13:263:28 | call to optionalSource() : |
106-
| test.swift:259:12:259:19 | call to source() : | test.swift:439:13:439:28 | call to optionalSource() : |
107-
| test.swift:259:12:259:19 | call to source() : | test.swift:466:13:466:28 | call to optionalSource() : |
106+
| test.swift:259:12:259:19 | call to source() : | test.swift:486:13:486:28 | call to optionalSource() : |
107+
| test.swift:259:12:259:19 | call to source() : | test.swift:513:13:513:28 | call to optionalSource() : |
108108
| test.swift:263:13:263:28 | call to optionalSource() : | test.swift:265:15:265:15 | x |
109109
| test.swift:263:13:263:28 | call to optionalSource() : | test.swift:267:15:267:16 | ...! |
110110
| test.swift:263:13:263:28 | call to optionalSource() : | test.swift:271:15:271:16 | ...? : |
@@ -145,33 +145,33 @@ edges
145145
| test.swift:357:15:357:15 | t1 [Tuple element at index 1] : | test.swift:357:15:357:18 | .1 |
146146
| test.swift:360:15:360:15 | t2 [Tuple element at index 0] : | test.swift:360:15:360:18 | .0 |
147147
| test.swift:361:15:361:15 | t2 [Tuple element at index 1] : | test.swift:361:15:361:18 | .1 |
148-
| test.swift:439:13:439:28 | call to optionalSource() : | test.swift:442:19:442:19 | a |
149-
| test.swift:462:9:462:9 | self [x] : | file://:0:0:0:0 | self [x] : |
150-
| test.swift:462:9:462:9 | value : | file://:0:0:0:0 | value : |
151-
| test.swift:466:13:466:28 | call to optionalSource() : | test.swift:468:12:468:12 | x : |
152-
| test.swift:468:5:468:5 | [post] cx [x] : | test.swift:472:20:472:20 | cx [x] : |
153-
| test.swift:468:12:468:12 | x : | test.swift:462:9:462:9 | value : |
154-
| test.swift:468:12:468:12 | x : | test.swift:468:5:468:5 | [post] cx [x] : |
155-
| test.swift:472:20:472:20 | cx [x] : | test.swift:462:9:462:9 | self [x] : |
156-
| test.swift:472:20:472:20 | cx [x] : | test.swift:472:20:472:23 | .x : |
157-
| test.swift:472:20:472:23 | .x : | test.swift:473:15:473:15 | z1 |
158-
| test.swift:479:14:479:21 | call to source() : | test.swift:479:13:479:21 | call to +(_:) |
159-
| test.swift:488:9:488:9 | self [str] : | file://:0:0:0:0 | self [str] : |
160-
| test.swift:489:10:489:13 | s : | test.swift:490:13:490:13 | s : |
161-
| test.swift:490:7:490:7 | [post] self [str] : | test.swift:489:5:491:5 | self[return] [str] : |
162-
| test.swift:490:13:490:13 | s : | test.swift:490:7:490:7 | [post] self [str] : |
163-
| test.swift:495:17:498:5 | self[return] [str] : | test.swift:503:13:503:41 | call to Self.init(contentsOfFile:) [str] : |
164-
| test.swift:496:7:496:7 | [post] self [str] : | test.swift:495:17:498:5 | self[return] [str] : |
165-
| test.swift:496:7:496:7 | [post] self [str] : | test.swift:497:17:497:17 | self [str] : |
166-
| test.swift:496:20:496:28 | call to source3() : | test.swift:489:10:489:13 | s : |
167-
| test.swift:496:20:496:28 | call to source3() : | test.swift:496:7:496:7 | [post] self [str] : |
168-
| test.swift:497:17:497:17 | self [str] : | test.swift:497:17:497:17 | .str |
169-
| test.swift:502:13:502:33 | call to MyClass.init(s:) [str] : | test.swift:488:9:488:9 | self [str] : |
170-
| test.swift:502:13:502:33 | call to MyClass.init(s:) [str] : | test.swift:502:13:502:35 | .str |
171-
| test.swift:502:24:502:32 | call to source3() : | test.swift:489:10:489:13 | s : |
172-
| test.swift:502:24:502:32 | call to source3() : | test.swift:502:13:502:33 | call to MyClass.init(s:) [str] : |
173-
| test.swift:503:13:503:41 | call to Self.init(contentsOfFile:) [str] : | test.swift:488:9:488:9 | self [str] : |
174-
| test.swift:503:13:503:41 | call to Self.init(contentsOfFile:) [str] : | test.swift:503:13:503:43 | .str |
148+
| test.swift:486:13:486:28 | call to optionalSource() : | test.swift:489:19:489:19 | a |
149+
| test.swift:509:9:509:9 | self [x] : | file://:0:0:0:0 | self [x] : |
150+
| test.swift:509:9:509:9 | value : | file://:0:0:0:0 | value : |
151+
| test.swift:513:13:513:28 | call to optionalSource() : | test.swift:515:12:515:12 | x : |
152+
| test.swift:515:5:515:5 | [post] cx [x] : | test.swift:519:20:519:20 | cx [x] : |
153+
| test.swift:515:12:515:12 | x : | test.swift:509:9:509:9 | value : |
154+
| test.swift:515:12:515:12 | x : | test.swift:515:5:515:5 | [post] cx [x] : |
155+
| test.swift:519:20:519:20 | cx [x] : | test.swift:509:9:509:9 | self [x] : |
156+
| test.swift:519:20:519:20 | cx [x] : | test.swift:519:20:519:23 | .x : |
157+
| test.swift:519:20:519:23 | .x : | test.swift:520:15:520:15 | z1 |
158+
| test.swift:526:14:526:21 | call to source() : | test.swift:526:13:526:21 | call to +(_:) |
159+
| test.swift:535:9:535:9 | self [str] : | file://:0:0:0:0 | self [str] : |
160+
| test.swift:536:10:536:13 | s : | test.swift:537:13:537:13 | s : |
161+
| test.swift:537:7:537:7 | [post] self [str] : | test.swift:536:5:538:5 | self[return] [str] : |
162+
| test.swift:537:13:537:13 | s : | test.swift:537:7:537:7 | [post] self [str] : |
163+
| test.swift:542:17:545:5 | self[return] [str] : | test.swift:550:13:550:41 | call to Self.init(contentsOfFile:) [str] : |
164+
| test.swift:543:7:543:7 | [post] self [str] : | test.swift:542:17:545:5 | self[return] [str] : |
165+
| test.swift:543:7:543:7 | [post] self [str] : | test.swift:544:17:544:17 | self [str] : |
166+
| test.swift:543:20:543:28 | call to source3() : | test.swift:536:10:536:13 | s : |
167+
| test.swift:543:20:543:28 | call to source3() : | test.swift:543:7:543:7 | [post] self [str] : |
168+
| test.swift:544:17:544:17 | self [str] : | test.swift:544:17:544:17 | .str |
169+
| test.swift:549:13:549:33 | call to MyClass.init(s:) [str] : | test.swift:535:9:535:9 | self [str] : |
170+
| test.swift:549:13:549:33 | call to MyClass.init(s:) [str] : | test.swift:549:13:549:35 | .str |
171+
| test.swift:549:24:549:32 | call to source3() : | test.swift:536:10:536:13 | s : |
172+
| test.swift:549:24:549:32 | call to source3() : | test.swift:549:13:549:33 | call to MyClass.init(s:) [str] : |
173+
| test.swift:550:13:550:41 | call to Self.init(contentsOfFile:) [str] : | test.swift:535:9:535:9 | self [str] : |
174+
| test.swift:550:13:550:41 | call to Self.init(contentsOfFile:) [str] : | test.swift:550:13:550:43 | .str |
175175
nodes
176176
| file://:0:0:0:0 | .a [x] : | semmle.label | .a [x] : |
177177
| file://:0:0:0:0 | .str : | semmle.label | .str : |
@@ -334,34 +334,34 @@ nodes
334334
| test.swift:360:15:360:18 | .0 | semmle.label | .0 |
335335
| test.swift:361:15:361:15 | t2 [Tuple element at index 1] : | semmle.label | t2 [Tuple element at index 1] : |
336336
| test.swift:361:15:361:18 | .1 | semmle.label | .1 |
337-
| test.swift:439:13:439:28 | call to optionalSource() : | semmle.label | call to optionalSource() : |
338-
| test.swift:442:19:442:19 | a | semmle.label | a |
339-
| test.swift:462:9:462:9 | self [x] : | semmle.label | self [x] : |
340-
| test.swift:462:9:462:9 | value : | semmle.label | value : |
341-
| test.swift:466:13:466:28 | call to optionalSource() : | semmle.label | call to optionalSource() : |
342-
| test.swift:468:5:468:5 | [post] cx [x] : | semmle.label | [post] cx [x] : |
343-
| test.swift:468:12:468:12 | x : | semmle.label | x : |
344-
| test.swift:472:20:472:20 | cx [x] : | semmle.label | cx [x] : |
345-
| test.swift:472:20:472:23 | .x : | semmle.label | .x : |
346-
| test.swift:473:15:473:15 | z1 | semmle.label | z1 |
347-
| test.swift:479:13:479:21 | call to +(_:) | semmle.label | call to +(_:) |
348-
| test.swift:479:14:479:21 | call to source() : | semmle.label | call to source() : |
349-
| test.swift:480:14:480:21 | call to source() | semmle.label | call to source() |
350-
| test.swift:488:9:488:9 | self [str] : | semmle.label | self [str] : |
351-
| test.swift:489:5:491:5 | self[return] [str] : | semmle.label | self[return] [str] : |
352-
| test.swift:489:10:489:13 | s : | semmle.label | s : |
353-
| test.swift:490:7:490:7 | [post] self [str] : | semmle.label | [post] self [str] : |
354-
| test.swift:490:13:490:13 | s : | semmle.label | s : |
355-
| test.swift:495:17:498:5 | self[return] [str] : | semmle.label | self[return] [str] : |
356-
| test.swift:496:7:496:7 | [post] self [str] : | semmle.label | [post] self [str] : |
357-
| test.swift:496:20:496:28 | call to source3() : | semmle.label | call to source3() : |
358-
| test.swift:497:17:497:17 | .str | semmle.label | .str |
359-
| test.swift:497:17:497:17 | self [str] : | semmle.label | self [str] : |
360-
| test.swift:502:13:502:33 | call to MyClass.init(s:) [str] : | semmle.label | call to MyClass.init(s:) [str] : |
361-
| test.swift:502:13:502:35 | .str | semmle.label | .str |
362-
| test.swift:502:24:502:32 | call to source3() : | semmle.label | call to source3() : |
363-
| test.swift:503:13:503:41 | call to Self.init(contentsOfFile:) [str] : | semmle.label | call to Self.init(contentsOfFile:) [str] : |
364-
| test.swift:503:13:503:43 | .str | semmle.label | .str |
337+
| test.swift:486:13:486:28 | call to optionalSource() : | semmle.label | call to optionalSource() : |
338+
| test.swift:489:19:489:19 | a | semmle.label | a |
339+
| test.swift:509:9:509:9 | self [x] : | semmle.label | self [x] : |
340+
| test.swift:509:9:509:9 | value : | semmle.label | value : |
341+
| test.swift:513:13:513:28 | call to optionalSource() : | semmle.label | call to optionalSource() : |
342+
| test.swift:515:5:515:5 | [post] cx [x] : | semmle.label | [post] cx [x] : |
343+
| test.swift:515:12:515:12 | x : | semmle.label | x : |
344+
| test.swift:519:20:519:20 | cx [x] : | semmle.label | cx [x] : |
345+
| test.swift:519:20:519:23 | .x : | semmle.label | .x : |
346+
| test.swift:520:15:520:15 | z1 | semmle.label | z1 |
347+
| test.swift:526:13:526:21 | call to +(_:) | semmle.label | call to +(_:) |
348+
| test.swift:526:14:526:21 | call to source() : | semmle.label | call to source() : |
349+
| test.swift:527:14:527:21 | call to source() | semmle.label | call to source() |
350+
| test.swift:535:9:535:9 | self [str] : | semmle.label | self [str] : |
351+
| test.swift:536:5:538:5 | self[return] [str] : | semmle.label | self[return] [str] : |
352+
| test.swift:536:10:536:13 | s : | semmle.label | s : |
353+
| test.swift:537:7:537:7 | [post] self [str] : | semmle.label | [post] self [str] : |
354+
| test.swift:537:13:537:13 | s : | semmle.label | s : |
355+
| test.swift:542:17:545:5 | self[return] [str] : | semmle.label | self[return] [str] : |
356+
| test.swift:543:7:543:7 | [post] self [str] : | semmle.label | [post] self [str] : |
357+
| test.swift:543:20:543:28 | call to source3() : | semmle.label | call to source3() : |
358+
| test.swift:544:17:544:17 | .str | semmle.label | .str |
359+
| test.swift:544:17:544:17 | self [str] : | semmle.label | self [str] : |
360+
| test.swift:549:13:549:33 | call to MyClass.init(s:) [str] : | semmle.label | call to MyClass.init(s:) [str] : |
361+
| test.swift:549:13:549:35 | .str | semmle.label | .str |
362+
| test.swift:549:24:549:32 | call to source3() : | semmle.label | call to source3() : |
363+
| test.swift:550:13:550:41 | call to Self.init(contentsOfFile:) [str] : | semmle.label | call to Self.init(contentsOfFile:) [str] : |
364+
| test.swift:550:13:550:43 | .str | semmle.label | .str |
365365
subpaths
366366
| test.swift:75:21:75:22 | &... : | test.swift:65:16:65:28 | arg1 : | test.swift:65:1:70:1 | arg2[return] : | test.swift:75:31:75:32 | [post] &... : |
367367
| test.swift:114:19:114:19 | arg : | test.swift:109:9:109:14 | arg : | test.swift:110:12:110:12 | arg : | test.swift:114:12:114:22 | call to ... : |
@@ -392,12 +392,12 @@ subpaths
392392
| test.swift:271:15:271:16 | ...? : | file://:0:0:0:0 | [summary param] this in signum() : | file://:0:0:0:0 | [summary] to write: return (return) in signum() : | test.swift:271:15:271:25 | call to signum() : |
393393
| test.swift:291:16:291:17 | ...? : | file://:0:0:0:0 | [summary param] this in signum() : | file://:0:0:0:0 | [summary] to write: return (return) in signum() : | test.swift:291:16:291:26 | call to signum() : |
394394
| test.swift:303:15:303:16 | ...! : | file://:0:0:0:0 | [summary param] this in signum() : | file://:0:0:0:0 | [summary] to write: return (return) in signum() : | test.swift:303:15:303:25 | call to signum() |
395-
| test.swift:468:12:468:12 | x : | test.swift:462:9:462:9 | value : | file://:0:0:0:0 | [post] self [x] : | test.swift:468:5:468:5 | [post] cx [x] : |
396-
| test.swift:472:20:472:20 | cx [x] : | test.swift:462:9:462:9 | self [x] : | file://:0:0:0:0 | .x : | test.swift:472:20:472:23 | .x : |
397-
| test.swift:496:20:496:28 | call to source3() : | test.swift:489:10:489:13 | s : | test.swift:490:7:490:7 | [post] self [str] : | test.swift:496:7:496:7 | [post] self [str] : |
398-
| test.swift:502:13:502:33 | call to MyClass.init(s:) [str] : | test.swift:488:9:488:9 | self [str] : | file://:0:0:0:0 | .str : | test.swift:502:13:502:35 | .str |
399-
| test.swift:502:24:502:32 | call to source3() : | test.swift:489:10:489:13 | s : | test.swift:489:5:491:5 | self[return] [str] : | test.swift:502:13:502:33 | call to MyClass.init(s:) [str] : |
400-
| test.swift:503:13:503:41 | call to Self.init(contentsOfFile:) [str] : | test.swift:488:9:488:9 | self [str] : | file://:0:0:0:0 | .str : | test.swift:503:13:503:43 | .str |
395+
| test.swift:515:12:515:12 | x : | test.swift:509:9:509:9 | value : | file://:0:0:0:0 | [post] self [x] : | test.swift:515:5:515:5 | [post] cx [x] : |
396+
| test.swift:519:20:519:20 | cx [x] : | test.swift:509:9:509:9 | self [x] : | file://:0:0:0:0 | .x : | test.swift:519:20:519:23 | .x : |
397+
| test.swift:543:20:543:28 | call to source3() : | test.swift:536:10:536:13 | s : | test.swift:537:7:537:7 | [post] self [str] : | test.swift:543:7:543:7 | [post] self [str] : |
398+
| test.swift:549:13:549:33 | call to MyClass.init(s:) [str] : | test.swift:535:9:535:9 | self [str] : | file://:0:0:0:0 | .str : | test.swift:549:13:549:35 | .str |
399+
| test.swift:549:24:549:32 | call to source3() : | test.swift:536:10:536:13 | s : | test.swift:536:5:538:5 | self[return] [str] : | test.swift:549:13:549:33 | call to MyClass.init(s:) [str] : |
400+
| test.swift:550:13:550:41 | call to Self.init(contentsOfFile:) [str] : | test.swift:535:9:535:9 | self [str] : | file://:0:0:0:0 | .str : | test.swift:550:13:550:43 | .str |
401401
#select
402402
| test.swift:7:15:7:15 | t1 | test.swift:6:19:6:26 | call to source() : | test.swift:7:15:7:15 | t1 | result |
403403
| test.swift:9:15:9:15 | t1 | test.swift:6:19:6:26 | call to source() : | test.swift:9:15:9:15 | t1 | result |
@@ -448,10 +448,10 @@ subpaths
448448
| test.swift:357:15:357:18 | .1 | test.swift:351:31:351:38 | call to source() : | test.swift:357:15:357:18 | .1 | result |
449449
| test.swift:360:15:360:18 | .0 | test.swift:351:18:351:25 | call to source() : | test.swift:360:15:360:18 | .0 | result |
450450
| test.swift:361:15:361:18 | .1 | test.swift:351:31:351:38 | call to source() : | test.swift:361:15:361:18 | .1 | result |
451-
| test.swift:442:19:442:19 | a | test.swift:259:12:259:19 | call to source() : | test.swift:442:19:442:19 | a | result |
452-
| test.swift:473:15:473:15 | z1 | test.swift:259:12:259:19 | call to source() : | test.swift:473:15:473:15 | z1 | result |
453-
| test.swift:479:13:479:21 | call to +(_:) | test.swift:479:14:479:21 | call to source() : | test.swift:479:13:479:21 | call to +(_:) | result |
454-
| test.swift:480:14:480:21 | call to source() | test.swift:480:14:480:21 | call to source() | test.swift:480:14:480:21 | call to source() | result |
455-
| test.swift:497:17:497:17 | .str | test.swift:496:20:496:28 | call to source3() : | test.swift:497:17:497:17 | .str | result |
456-
| test.swift:502:13:502:35 | .str | test.swift:502:24:502:32 | call to source3() : | test.swift:502:13:502:35 | .str | result |
457-
| test.swift:503:13:503:43 | .str | test.swift:496:20:496:28 | call to source3() : | test.swift:503:13:503:43 | .str | result |
451+
| test.swift:489:19:489:19 | a | test.swift:259:12:259:19 | call to source() : | test.swift:489:19:489:19 | a | result |
452+
| test.swift:520:15:520:15 | z1 | test.swift:259:12:259:19 | call to source() : | test.swift:520:15:520:15 | z1 | result |
453+
| test.swift:526:13:526:21 | call to +(_:) | test.swift:526:14:526:21 | call to source() : | test.swift:526:13:526:21 | call to +(_:) | result |
454+
| test.swift:527:14:527:21 | call to source() | test.swift:527:14:527:21 | call to source() | test.swift:527:14:527:21 | call to source() | result |
455+
| test.swift:544:17:544:17 | .str | test.swift:543:20:543:28 | call to source3() : | test.swift:544:17:544:17 | .str | result |
456+
| test.swift:549:13:549:35 | .str | test.swift:549:24:549:32 | call to source3() : | test.swift:549:13:549:35 | .str | result |
457+
| test.swift:550:13:550:43 | .str | test.swift:543:20:543:28 | call to source3() : | test.swift:550:13:550:43 | .str | result |

0 commit comments

Comments
 (0)