Sha256: 1028c0b5e275edafe4def9bd0d19be9f138254e1c67beccfd2c5bd9f4c69bc54

Contents?: true

Size: 582 Bytes

Versions: 4

Compression:

Stored size: 582 Bytes

Contents

require File.expand_path('../test_helper.rb', File.dirname(__FILE__))

describe GirFFI::CallbackHelper do
  describe ".map_single_callback_arg" do
    it "correctly maps a :struct type" do
      GirFFI.setup :GObject

      cl = GObject::Closure.new_simple GObject::Closure::Struct.size, nil

      cinfo = GirFFI::IRepository.default.find_by_name 'GObject', 'ClosureMarshal'
      ainfo = cinfo.args[0]

      r = GirFFI::CallbackHelper.map_single_callback_arg cl.to_ptr, ainfo

      assert_instance_of GObject::Closure, r
      assert_equal r.to_ptr, cl.to_ptr
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gir_ffi-0.0.14 test/unit/callback_helper_test.rb
gir_ffi-0.0.13 test/unit/callback_helper_test.rb
gir_ffi-0.0.12 test/unit/callback_helper_test.rb
gir_ffi-0.0.11 test/unit/callback_helper_test.rb