aboutsummaryrefslogtreecommitdiffstats
path: root/test/dl
diff options
context:
space:
mode:
Diffstat (limited to 'test/dl')
-rw-r--r--test/dl/test_func.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/dl/test_func.rb b/test/dl/test_func.rb
index ab8353bd76..d438f94506 100644
--- a/test/dl/test_func.rb
+++ b/test/dl/test_func.rb
@@ -46,6 +46,18 @@ module DL
assert_equal("123", str.to_s)
end
+ def test_string()
+ stress, GC.stress = GC.stress, true
+ f = Function.new(CFunc.new(@libc['strcpy'], TYPE_VOIDP, 'strcpy'),
+ [TYPE_VOIDP, TYPE_VOIDP])
+ buff = "000"
+ str = f.call(buff, "123")
+ assert_equal("123", buff)
+ assert_equal("123", str.to_s)
+ ensure
+ GC.stress = stress
+ end
+
def test_isdigit()
f = Function.new(CFunc.new(@libc['isdigit'], TYPE_INT, 'isdigit'),
[TYPE_INT])