Skip to content

Commit

Permalink
Add a spec regarding issue ffi#788
Browse files Browse the repository at this point in the history
  • Loading branch information
larskanis committed Jun 9, 2020
1 parent 90f4fca commit f2d35a9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/ffi/library_spec.rb
Expand Up @@ -64,6 +64,20 @@ class StructUCDP < FFI::Struct
end
end

if RbConfig::CONFIG['host_os'] =~ /mingw/
# See https://github.com/ffi/ffi/issues/788
it "libc functions shouldn't call an invalid parameter handler" do
mod = Module.new do
extend FFI::Library
ffi_lib 'c'
attach_function(:get_osfhandle, :_get_osfhandle, [:int], :intptr_t)
end

expect( mod.get_osfhandle(42) ).to eq(-1)
end
end


describe "ffi_lib" do
it "empty name list should raise error" do
expect {
Expand Down

0 comments on commit f2d35a9

Please sign in to comment.