Sha256: b2aa2167d3cab051d428df7762b83c2c91f25c414ebea0a29f3c21bc7a22ab8c

Contents?: true

Size: 633 Bytes

Versions: 4

Compression:

Stored size: 633 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), "spec_helper"))

describe "async callback" do
  module LibTest
    extend FFI::Library
    ffi_lib TestLibrary::PATH
    AsyncIntCallback = callback [ :int ], :void

#    @blocking = true
    attach_function :testAsyncCallback, [ AsyncIntCallback, :int ], :void, :blocking => true
  end

#  unless RUBY_VERSION =~ /1.8/
    it ":int (0x7fffffff) argument" do
      v = 0xdeadbeef
      called = false
      cb = Proc.new {|i| v = i; called = true }
      LibTest.testAsyncCallback(cb, 0x7fffffff) 
      called.should be_true
      v.should == 0x7fffffff
    end
#  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ffi-1.0.4-x86-mingw32 spec/ffi/async_callback_spec.rb
ffi-1.0.4 spec/ffi/async_callback_spec.rb
ffi-1.0.3-x86-mingw32 spec/ffi/async_callback_spec.rb
ffi-1.0.3 spec/ffi/async_callback_spec.rb