File tree 1 file changed +22
-0
lines changed 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,28 @@ mod test {
161
161
use libc;
162
162
use mem;
163
163
164
+ // This is a basic smoke test that loading from the exe works, in order to provide
165
+ // some Windows coverage (FIXME #8818)
166
+ #[ test]
167
+ #[ ignore( cfg( target_os="android" ) ) ] // FIXME(#10379)
168
+ fn test_loading_internal_smoke ( ) {
169
+
170
+ let none: Option < Path > = None ; // appease the typechecker
171
+ let thislib = match DynamicLibrary :: open ( none) {
172
+ Err ( error) => fail ! ( "Could not load self as module: {}" , error) ,
173
+ Ok ( thislib) => thislib
174
+ } ;
175
+
176
+ // 'main' is the only function that happens to have DllExport on windows,
177
+ // so let's try to load it (using the wrong sig since we're not calling it)
178
+ let _main: extern fn ( ) = unsafe {
179
+ match thislib. symbol ( "main" ) {
180
+ Err ( error) => fail ! ( "Could not load function testcos: {}" , error) ,
181
+ Ok ( cosine) => mem:: transmute :: < * mut u8 , _ > ( cosine)
182
+ }
183
+ } ;
184
+ }
185
+
164
186
#[ test]
165
187
#[ ignore( cfg( windows) ) ] // FIXME #8818
166
188
#[ ignore( cfg( target_os="android" ) ) ] // FIXME(#10379)
You can’t perform that action at this time.
0 commit comments