Sha256: c85094ac0a4bc032d7796b7fe8033ee887623390b754c35abddbe4b50b3bd92d

Contents?: true

Size: 535 Bytes

Versions: 5

Compression:

Stored size: 535 Bytes

Contents

require "test_helper"

describe "Function pointers" do
  before(:all) do
    @fp_source = RbGCCXML.parse(full_dir("headers/types.h")).namespaces("types")
  end

  specify "have arguments" do
    fp = @fp_source.functions("takesCallback").arguments[0].cpp_type.base_type
    fp.arguments.length.should == 1
    fp.arguments[0].cpp_type.name.should == "int"
  end

  specify "have return value" do
    fp = @fp_source.functions("takesCallbackWithReturn").arguments[0].cpp_type.base_type
    fp.return_type.name.should == "int"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rbgccxml-1.0.4 spec/function_pointers_test.rb
rbgccxml-1.0.3 spec/function_pointers_test.rb
rbgccxml-1.0.2 spec/function_pointers_test.rb
rbgccxml-1.0.1 spec/function_pointers_test.rb
rbgccxml-1.0 test/function_pointers_test.rb