コード例 #1
0
 def test_it_raises_ruby_TypeError_on_anything_else(self, space):
     with self.raises(space, "TypeError",
                      "can't convert Symbol into FFI::Pointer"):
         coerce_address(space, space.newsymbol('error'))
コード例 #2
0
 def test_it_accepts_ruby_Bignum_as_address(self, space):
     assert coerce_address(space, space.newbigint_fromint(1)) == 1
コード例 #3
0
 def test_it_accepts_FFI__Pointer_as_address(self, space):
     w_ptr = space.execute("FFI::Pointer.new(6)")
     assert coerce_address(space, w_ptr) == 6
コード例 #4
0
 def test_it_accepts_ruby_Fixnum_as_address(self, space):
     assert coerce_address(space, space.newint(2)) == 2
コード例 #5
0
ファイル: test_pointer.py プロジェクト: mswart/topaz
 def test_it_raises_ruby_TypeError_on_anything_else(self, space):
     with self.raises(space, "TypeError",
                      "can't convert Symbol into FFI::Pointer"):
         coerce_address(space, space.newsymbol('error'))
コード例 #6
0
ファイル: test_pointer.py プロジェクト: mswart/topaz
 def test_it_accepts_FFI__Pointer_as_address(self, space):
     w_ptr = space.execute("FFI::Pointer.new(6)")
     assert coerce_address(space, w_ptr) == 6
コード例 #7
0
ファイル: test_pointer.py プロジェクト: mswart/topaz
 def test_it_accepts_ruby_Bignum_as_address(self, space):
     assert coerce_address(space, space.newbigint_fromint(1)) == 1
コード例 #8
0
ファイル: test_pointer.py プロジェクト: mswart/topaz
 def test_it_accepts_ruby_Fixnum_as_address(self, space):
     assert coerce_address(space, space.newint(2)) == 2