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: [])
2424@Suite
2525@MainActor
2626struct 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 " ) )
3228 func javaObjectManagement( ) throws {
3329 let sneakyJavaThis : jobject
3430 do {
@@ -54,12 +50,8 @@ struct BasicRuntimeTests {
5450 #expect( url. javaHolder === urlAgain. javaHolder)
5551 }
5652
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 {
6355 do {
6456 _ = try URL ( " bad url " , environment: jvm. environment)
6557 } catch {
@@ -77,3 +69,12 @@ struct BasicRuntimeTests {
7769 #expect( urlConnectionClass. getDefaultAllowUserInteraction ( ) == false )
7870 }
7971}
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