diff options
Diffstat (limited to 'test/dl/test_dl2.rb')
-rw-r--r-- | test/dl/test_dl2.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/dl/test_dl2.rb b/test/dl/test_dl2.rb index ac1414920f..7b47fc8024 100644 --- a/test/dl/test_dl2.rb +++ b/test/dl/test_dl2.rb @@ -88,14 +88,16 @@ class TestDL < TestBase assert_in_delta(-0.1, x) end - def test_sin() + def test_sin pi_2 = Math::PI/2 - cfunc = CFunc.new(@libm['sin'], TYPE_DOUBLE, 'sin') - x = cfunc.call([pi_2].pack("d").unpack("l!*")) + cfunc = Function.new(CFunc.new(@libm['sin'], TYPE_DOUBLE, 'sin'), + [TYPE_DOUBLE]) + x = cfunc.call(pi_2) assert_equal(Math.sin(pi_2), x) - cfunc = CFunc.new(@libm['sin'], TYPE_DOUBLE, 'sin') - x = cfunc.call([-pi_2].pack("d").unpack("l!*")) + cfunc = Function.new(CFunc.new(@libm['sin'], TYPE_DOUBLE, 'sin'), + [TYPE_DOUBLE]) + x = cfunc.call(-pi_2) assert_equal(Math.sin(-pi_2), x) end |