Sha256: da5b6e2b6469dc3dc6e8c7c03366004fdd0a05821ba6bc6b8d4e8ed59d9756c9
Contents?: true
Size: 998 Bytes
Versions: 1
Compression:
Stored size: 998 Bytes
Contents
require File.dirname(__FILE__) + '/test_helper' context "properly handles and wraps function pointer arguments" do def setup if !defined?(@@function_pointers) super @@function_pointers = true Extension.new "function_pointers" do |e| e.sources full_dir("headers/function_pointers.h") node = e.namespace "function_pointers" end require 'function_pointers' end end specify "no arguments, no return" do proc_called = false set_callback do proc_called = true end call_callback assert proc_called end specify "arguments, no return" do proc_arg = nil set_callback_with_args do |i| proc_arg = i end call_callback_with_args(10) proc_arg.should == 10 end specify "arguments and return" do proc_arg = nil set_callback_returns do |i| proc_arg = i i * 10 end ret = call_callback_returns(8) proc_arg.should == 8 ret.should == 80 end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rbplusplus-0.9 | test/function_pointer_test.rb |