Skip to content

Commit 6a2911a

Browse files
committed
Swift: Make the tests more accurate.
1 parent 086002f commit 6a2911a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

swift/ql/test/library-tests/dataflow/taint/libraries/files.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ enum CInterop {
99
typealias PlatformChar = CInterop.Char
1010
}
1111

12-
struct FilePath {
12+
struct FilePath : CustomStringConvertible, CustomDebugStringConvertible {
1313
struct Component {
1414
init?(_ string: String) { }
1515

@@ -184,8 +184,8 @@ func test_files(e1: Encoder) {
184184

185185
// --- FilePath member variables ---
186186

187-
sink(string: tainted.description) // $ MISSING: tainted=133
188-
sink(string: tainted.debugDescription) // $ MISSING: tainted=133
187+
sink(string: tainted.description) // $ tainted=133
188+
sink(string: tainted.debugDescription) // $ tainted=133
189189
sink(string: tainted.extension!) // $ tainted=133
190190
sink(string: tainted.stem!) // $ tainted=133
191191
sink(string: tainted.string) // $ tainted=133

swift/ql/test/library-tests/dataflow/taint/libraries/url.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ struct URLResource {
154154
let subdirectory: String?
155155
}
156156

157-
struct URLRequest {
157+
struct URLRequest : CustomStringConvertible, CustomDebugStringConvertible {
158158
enum CachePolicy { case none }
159159
enum NetworkServiceType { case none }
160160
enum Attribution { case none }
@@ -463,9 +463,9 @@ func taintThroughUrlRequest() {
463463
sink(any: clean.attribution)
464464
sink(any: tainted.attribution)
465465
sink(any: clean.description)
466-
sink(any: tainted.description)
466+
sink(any: tainted.description) // $ tainted=431
467467
sink(any: clean.debugDescription)
468-
sink(any: tainted.debugDescription)
468+
sink(any: tainted.debugDescription) // $ tainted=431
469469
sink(any: clean.customMirror)
470470
sink(any: tainted.customMirror)
471471
sink(any: clean.hashValue)

0 commit comments

Comments
 (0)