File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -24,11 +24,7 @@ let jvm = try! JavaVirtualMachine(vmOptions: [])
24
24
@Suite
25
25
@MainActor
26
26
struct BasicRuntimeTests {
27
- #if os(Linux)
28
- @Test ( " Object management " , . disabled( " Attempts to refcount a null pointer on Linux " ) )
29
- #else
30
- @Test ( " Object management " , . disabled( " Bad pointer de-reference on Linux " ) )
31
- #endif
27
+ @Test ( " Object management " , . disabled( if: isLinux, " Attempts to refcount a null pointer on Linux " ) )
32
28
func javaObjectManagement( ) throws {
33
29
let sneakyJavaThis : jobject
34
30
do {
@@ -54,12 +50,8 @@ struct BasicRuntimeTests {
54
50
#expect( url. javaHolder === urlAgain. javaHolder)
55
51
}
56
52
57
- #if os(Linux)
58
- @Test ( " Java exceptions " , . disabled( " Attempts to refcount a null pointer on Linux " ) )
59
- #else
60
- @Test ( " Java exceptions " )
61
- #endif
62
- func javaExceptionsInSwift( ) async throws {
53
+ @Test ( " Java exceptions " , . disabled( if: isLinux, " Attempts to refcount a null pointer on Linux " ) )
54
+ func javaExceptionsInSwift( ) throws {
63
55
do {
64
56
_ = try URL ( " bad url " , environment: jvm. environment)
65
57
} catch {
@@ -77,3 +69,12 @@ struct BasicRuntimeTests {
77
69
#expect( urlConnectionClass. getDefaultAllowUserInteraction ( ) == false )
78
70
}
79
71
}
72
+
73
+ /// Whether we're running on Linux.
74
+ var isLinux : Bool {
75
+ #if os(Linux)
76
+ return true
77
+ #else
78
+ return false
79
+ #endif
80
+ }
You can’t perform that action at this time.
0 commit comments