mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test/fiddle: revert r52384 partially
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b3602a5453
commit
0445b5f6c6
4 changed files with 7 additions and 7 deletions
|
@ -6,15 +6,15 @@ end
|
||||||
module Fiddle
|
module Fiddle
|
||||||
class TestClosure < Fiddle::TestCase
|
class TestClosure < Fiddle::TestCase
|
||||||
def test_argument_errors
|
def test_argument_errors
|
||||||
assert_raise(TypeError) do
|
assert_raises(TypeError) do
|
||||||
Closure.new(TYPE_INT, TYPE_INT)
|
Closure.new(TYPE_INT, TYPE_INT)
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_raise(TypeError) do
|
assert_raises(TypeError) do
|
||||||
Closure.new('foo', [TYPE_INT])
|
Closure.new('foo', [TYPE_INT])
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_raise(TypeError) do
|
assert_raises(TypeError) do
|
||||||
Closure.new(TYPE_INT, ['meow!'])
|
Closure.new(TYPE_INT, ['meow!'])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -60,7 +60,7 @@ module Fiddle
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_undefined_ctype
|
def test_undefined_ctype
|
||||||
assert_raise(DLError) { parse_ctype('DWORD') }
|
assert_raises(DLError) { parse_ctype('DWORD') }
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_undefined_ctype_with_type_alias
|
def test_undefined_ctype_with_type_alias
|
||||||
|
@ -92,7 +92,7 @@ module Fiddle
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_struct_undefined
|
def test_struct_undefined
|
||||||
assert_raise(DLError) { parse_struct_signature(['int i', 'DWORD cb']) }
|
assert_raises(DLError) { parse_struct_signature(['int i', 'DWORD cb']) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_struct_undefined_with_type_alias
|
def test_struct_undefined_with_type_alias
|
||||||
|
|
|
@ -12,7 +12,7 @@ module Fiddle
|
||||||
|
|
||||||
def test_syscall_with_tainted_string
|
def test_syscall_with_tainted_string
|
||||||
f = Function.new(@libc['system'], [TYPE_VOIDP], TYPE_INT)
|
f = Function.new(@libc['system'], [TYPE_VOIDP], TYPE_INT)
|
||||||
assert_raise(SecurityError) do
|
assert_raises(SecurityError) do
|
||||||
Thread.new {
|
Thread.new {
|
||||||
$SAFE = 1
|
$SAFE = 1
|
||||||
f.call("uname -rs".taint)
|
f.call("uname -rs".taint)
|
||||||
|
|
|
@ -44,7 +44,7 @@ module Fiddle
|
||||||
|
|
||||||
class TestImport < TestCase
|
class TestImport < TestCase
|
||||||
def test_ensure_call_dlload
|
def test_ensure_call_dlload
|
||||||
err = assert_raise(RuntimeError) do
|
err = assert_raises(RuntimeError) do
|
||||||
Class.new do
|
Class.new do
|
||||||
extend Importer
|
extend Importer
|
||||||
extern "void *strcpy(char*, char*)"
|
extern "void *strcpy(char*, char*)"
|
||||||
|
|
Loading…
Add table
Reference in a new issue