Sha256: b676c6be5c2e080a561e881d4a914229c7c4a237a35889e33a0e7741bcc9fc9f

Contents?: true

Size: 861 Bytes

Versions: 10

Compression:

Stored size: 861 Bytes

Contents

require 'gir_ffi_test_helper'

GirFFI.setup :Regress

describe GirFFI::InfoExt::ISignalInfo do
  let(:klass) do
    Class.new do
      include GirFFI::InfoExt::ICallableInfo
      include GirFFI::InfoExt::ISignalInfo
    end
  end
  let(:signal_info) { klass.new }

  describe '#arguments_to_gvalues' do
    let(:object) { Regress::TestSubObj.new }
    let(:boxed) { Regress::TestSimpleBoxedA.const_return }
    let(:signal_info) { Regress::TestSubObj.find_signal 'test-with-static-scope-arg' }
    let(:result) { signal_info.arguments_to_gvalues(object, [boxed]) }

    it 'correctly wraps :object' do
      result[0].get_value.must_equal object
    end

    it 'correctly wraps :struct' do
      result_boxed = result[1].get_value
      result_boxed.some_int8.must_equal boxed.some_int8
      result_boxed.some_int.must_equal boxed.some_int
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gir_ffi-0.9.2 test/gir_ffi/info_ext/i_signal_info_test.rb
gir_ffi-0.9.1 test/gir_ffi/info_ext/i_signal_info_test.rb
gir_ffi-0.9.0 test/gir_ffi/info_ext/i_signal_info_test.rb
gir_ffi-0.8.6 test/gir_ffi/info_ext/i_signal_info_test.rb
gir_ffi-0.8.5 test/gir_ffi/info_ext/i_signal_info_test.rb
gir_ffi-0.8.4 test/gir_ffi/info_ext/i_signal_info_test.rb
gir_ffi-0.8.3 test/gir_ffi/info_ext/i_signal_info_test.rb
gir_ffi-0.8.2 test/gir_ffi/info_ext/i_signal_info_test.rb
gir_ffi-0.8.1 test/gir_ffi/info_ext/i_signal_info_test.rb
gir_ffi-0.8.0 test/gir_ffi/info_ext/i_signal_info_test.rb