Skip to content

Commit cdc7fb4

Browse files
authored
Merge pull request #18089 from jrose-apple/unfamiliar-environment
2 parents 1e1c202 + 2947fd5 commit cdc7fb4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

test/Interpreter/SDK/class_getImageName.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,16 @@ func check(_ cls: AnyClass, in library: String) {
2222
"wrong library for \(cls)")
2323
}
2424

25-
var cannotUseObjCRuntimeHook = false
26-
#if targetEnvironment(device) && !os(macOS)
27-
if #available(iOS 12, tvOS 12, watchOS 5, *) {
25+
var newOSButCannotUseObjCRuntimeHook = false
26+
if #available(macOS 10.14, iOS 12, tvOS 12, watchOS 5, *) {
2827
// The only place these tests will fail is on early versions of the 2018 OSs.
2928
// The final versions will have 'objc_setHook_getImageName'; anything earlier
3029
// will be handled by manually overwriting the original implementation of
3130
// 'class_getImageName'.
32-
cannotUseObjCRuntimeHook =
31+
newOSButCannotUseObjCRuntimeHook =
3332
(nil == dlsym(UnsafeMutableRawPointer(bitPattern: -2),
3433
"objc_setHook_getImageName"))
3534
}
36-
#endif // targetEnvironment(device) && !os(macOS)
3735

3836
var testSuite = TestSuite("class_getImageName")
3937

@@ -43,7 +41,7 @@ testSuite.test("Simple") {
4341
}
4442

4543
testSuite.test("Generic")
46-
.xfail(.custom({ cannotUseObjCRuntimeHook },
44+
.skip(.custom({ newOSButCannotUseObjCRuntimeHook },
4745
reason: "hook for class_getImageName not present"))
4846
.code {
4947
check(GenericSwiftObject<Int>.self, in: "libGetImageNameHelper.dylib")
@@ -54,7 +52,7 @@ testSuite.test("Generic")
5452
}
5553

5654
testSuite.test("GenericAncestry")
57-
.xfail(.custom({ cannotUseObjCRuntimeHook },
55+
.skip(.custom({ newOSButCannotUseObjCRuntimeHook },
5856
reason: "hook for class_getImageName not present"))
5957
.code {
6058
check(GenericAncestrySwiftObject.self, in: "libGetImageNameHelper.dylib")

0 commit comments

Comments
 (0)