Sha256: b8bf9e0d799a9bada3afc0ad2d4ad4627b5f18d3b8f3a19c85c7f5c253f30d8c

Contents?: true

Size: 706 Bytes

Versions: 2

Compression:

Stored size: 706 Bytes

Contents

# frozen_string_literal: true
require 'gir_ffi_test_helper'

GirFFI.setup :GIMarshallingTests

describe GirFFI::BoxedBase do
  describe 'wrap_copy' do
    it 'returns a wrapped copy with owned true' do
      original = GIMarshallingTests::BoxedStruct.new
      copy = GIMarshallingTests::BoxedStruct.wrap_copy(original.to_ptr)
      copy.to_ptr.wont_equal original.to_ptr
      copy.struct.must_be :owned?
    end
  end

  describe 'copy_from' do
    it 'returns a copy with owned false' do
      original = GIMarshallingTests::BoxedStruct.new
      copy = GIMarshallingTests::BoxedStruct.copy_from(original)
      copy.to_ptr.wont_equal original.to_ptr
      copy.struct.wont_be :owned?
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gir_ffi-0.10.2 test/gir_ffi/boxed_base_test.rb
gir_ffi-0.10.1 test/gir_ffi/boxed_base_test.rb