@@ -10,7 +10,7 @@ dlls = Libdl.dllist()
10
10
@test length (dlls) > 3 # at a bare minimum, probably have some version of libstdc, libgcc, libjulia, ...
11
11
if ! Sys. iswindows () || Sys. windows_version () >= Sys. WINDOWS_VISTA_VER
12
12
for dl in dlls
13
- if isfile (dl) && (Libdl. dlopen_e (dl) != C_NULL )
13
+ if isfile (dl) && (Libdl. dlopen (dl; throw_error = false ) != C_NULL )
14
14
@test Base. samefile (Libdl. dlpath (dl), dl)
15
15
end
16
16
end
45
45
# dlopen should be able to handle absolute and relative paths, with and without dlext
46
46
let dl = C_NULL
47
47
try
48
- dl = Libdl. dlopen_e (abspath (joinpath (private_libdir, " libccalltest" )))
49
- @test dl != C_NULL
48
+ dl = Libdl. dlopen (abspath (joinpath (private_libdir, " libccalltest" )); throw_error = false )
49
+ @test dl != = nothing
50
50
finally
51
51
Libdl. dlclose (dl)
52
52
end
53
53
end
54
54
55
55
let dl = C_NULL
56
56
try
57
- dl = Libdl. dlopen_e (abspath (joinpath (private_libdir, " libccalltest.$(Libdl. dlext) " )))
58
- @test dl != C_NULL
57
+ dl = Libdl. dlopen (abspath (joinpath (private_libdir, " libccalltest.$(Libdl. dlext) " )); throw_error = false )
58
+ @test dl != = nothing
59
59
finally
60
60
Libdl. dlclose (dl)
61
61
end
62
62
end
63
63
64
64
let dl = C_NULL
65
65
try
66
- dl = Libdl. dlopen_e (relpath (joinpath (private_libdir, " libccalltest" )))
67
- @test dl != C_NULL
66
+ dl = Libdl. dlopen (relpath (joinpath (private_libdir, " libccalltest" )); throw_error = false )
67
+ @test dl != = nothing
68
68
finally
69
69
Libdl. dlclose (dl)
70
70
end
71
71
end
72
72
73
73
let dl = C_NULL
74
74
try
75
- dl = Libdl. dlopen_e (relpath (joinpath (private_libdir, " libccalltest.$(Libdl. dlext) " )))
76
- @test dl != C_NULL
75
+ dl = Libdl. dlopen (relpath (joinpath (private_libdir, " libccalltest.$(Libdl. dlext) " )); throw_error = false )
76
+ @test dl != = nothing
77
77
finally
78
78
Libdl. dlclose (dl)
79
79
end
80
80
end
81
81
82
82
let dl = C_NULL
83
83
try
84
- dl = Libdl. dlopen_e (" ./foo" )
85
- @test dl == C_NULL
84
+ dl = Libdl. dlopen (" ./foo" ; throw_error = false )
85
+ @test dl === nothing
86
86
finally
87
87
Libdl. dlclose (dl)
88
88
end
91
91
# unqualified names present in DL_LOAD_PATH
92
92
let dl = C_NULL
93
93
try
94
- dl = Libdl. dlopen_e (" libccalltest" )
95
- @test dl != C_NULL
94
+ dl = Libdl. dlopen (" libccalltest" ; throw_error = false )
95
+ @test dl != = nothing
96
96
finally
97
97
Libdl. dlclose (dl)
98
98
end
99
99
end
100
100
101
101
let dl = C_NULL
102
102
try
103
- dl = Libdl. dlopen_e (string (" libccalltest" ," ." ,Libdl. dlext))
104
- @test dl != C_NULL
103
+ dl = Libdl. dlopen (string (" libccalltest" ," ." ,Libdl. dlext); throw_error = false )
104
+ @test dl != = nothing
105
105
finally
106
106
Libdl. dlclose (dl)
107
107
end
149
149
let dl = C_NULL
150
150
try
151
151
path = abspath (joinpath (private_libdir, " libccalltest" ))
152
- dl = Libdl. dlopen (path)
153
- @test dl != C_NULL
152
+ dl = Libdl. dlopen (path; throw_error = false )
153
+ @test dl != = nothing
154
154
@test Base. samefile (abspath (Libdl. dlpath (dl)),
155
155
abspath (Libdl. dlpath (path)))
156
156
@test Base. samefile (abspath (Libdl. dlpath (dl)),
@@ -193,8 +193,8 @@ let dl = C_NULL
193
193
@test - 1 == ccall (:jl_dlclose , Cint, (Ptr{Cvoid},), dl)
194
194
@test ! Libdl. dlclose (dl)
195
195
196
- dl = Libdl. dlopen_e (" libccalltest" )
197
- @test dl != C_NULL
196
+ dl = Libdl. dlopen (" libccalltest" ; throw_error = false )
197
+ @test dl != = nothing
198
198
199
199
@test Libdl. dlclose (dl)
200
200
@test_skip ! Libdl. dlclose (dl) # Syscall doesn't fail on Win32
0 commit comments