diff options
author | Lars Kanis <lars@greiz-reinsdorf.de> | 2023-05-08 13:21:33 +0200 |
---|---|---|
committer | Lars Kanis <lars@greiz-reinsdorf.de> | 2023-05-08 13:21:33 +0200 |
commit | c6b7139d0394638ef51b451b81dcd2ffefb94160 (patch) | |
tree | f1513b0afc5ef798382100a53c3191ff52e66d3e /spec/ffi/rbx/memory_pointer_spec.rb | |
parent | c1e6a14476e210efeac79aa260c2eb2d1d98a580 (diff) | |
parent | 938b5d8590361acf871fddb9149fe725f65d781f (diff) | |
download | ffi-c6b7139d0394638ef51b451b81dcd2ffefb94160.tar.gz |
Merge branch 'ractor'
Diffstat (limited to 'spec/ffi/rbx/memory_pointer_spec.rb')
-rw-r--r-- | spec/ffi/rbx/memory_pointer_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/ffi/rbx/memory_pointer_spec.rb b/spec/ffi/rbx/memory_pointer_spec.rb index 2db89a9..1270c9b 100644 --- a/spec/ffi/rbx/memory_pointer_spec.rb +++ b/spec/ffi/rbx/memory_pointer_spec.rb @@ -104,6 +104,18 @@ describe "MemoryPointer" do expect(m.read FFI::Type::BOOL).to eq(false) end + it "allows definition of a custom typedef" do + FFI.typedef :uint32, :fubar_t + expect(FFI.find_type(:fubar_t)).to eq(FFI::Type::Builtin::UINT32) + end + + it "allows overwriting of a default typedef" do + FFI.typedef :uint32, :char + expect(FFI.find_type(:char)).to eq(FFI::Type::Builtin::UINT32) + ensure + FFI.typedef FFI::Type::Builtin::CHAR, :char + end + it "allows writing a custom typedef" do FFI.typedef :uint, :fubar_t FFI.typedef :size_t, :fubar2_t |