Skip to content

Commit 5cf10f2

Browse files
[test] Make KeyPath test pointer-size agnostic
The field offset of the `age` property is 16 bytes on 64-bit platforms but not on other pointer-sized platforms.
1 parent 262e238 commit 5cf10f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/stdlib/KeyPath.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ if #available(SwiftStdlib 5.9, *) {
10781078
let dogAgeKp = _createOffsetBasedKeyPath(
10791079
root: Dog.self,
10801080
value: Int.self,
1081-
offset: 16
1081+
offset: MemoryLayout<String>.size
10821082
) as? KeyPath<Dog, Int>
10831083

10841084
expectNotNil(dogAgeKp)

0 commit comments

Comments
 (0)