* ext/dl/test/test_import.rb: fix character code.

* ext/dl/test/test_func.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-08-30 14:39:21 +00:00
Родитель 74f9ec7e4f
Коммит 8eb12fc30e
3 изменённых файлов: 15 добавлений и 9 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Sat Aug 30 23:38:00 2008 Tanaka Akira <akr@fsij.org>
* ext/dl/test/test_import.rb: fix character code.
* ext/dl/test/test_func.rb: ditto.
Sat Aug 30 22:23:31 2008 Tadayoshi Funaba <tadf@dotrb.org>
* rational.c: added a static variable for nurat_to_f.

Просмотреть файл

@ -15,9 +15,9 @@ module DL
def test_isdigit()
f = Function.new(CFunc.new(@libc['isdigit'], TYPE_INT, 'isdigit'),
[TYPE_INT])
r1 = f.call(?1)
r2 = f.call(?2)
rr = f.call(?r)
r1 = f.call(?1.ord)
r2 = f.call(?2.ord)
rr = f.call(?r.ord)
assert_positive(r1)
assert_positive(r2)
assert_zero(rr)

Просмотреть файл

@ -95,11 +95,11 @@ module DL
def test_struct()
s = LIBC::MyStruct.malloc()
s.num = [0,1,2,3,4]
s.c = ?a
s.c = ?a.ord
s.buff = "012345\377"
assert_equal([0,1,2,3,4], s.num)
assert_equal(?a, s.c)
assert_equal([?0,?1,?2,?3,?4,?5,?\377], s.buff)
assert_equal(?a.ord, s.c)
assert_equal([?0.ord,?1.ord,?2.ord,?3.ord,?4.ord,?5.ord,?\377.ord], s.buff)
end
def test_gettimeofday()
@ -120,9 +120,9 @@ module DL
end
def test_isdigit()
r1 = LIBC.isdigit(?1)
r2 = LIBC.isdigit(?2)
rr = LIBC.isdigit(?r)
r1 = LIBC.isdigit(?1.ord)
r2 = LIBC.isdigit(?2.ord)
rr = LIBC.isdigit(?r.ord)
assert_positive(r1)
assert_positive(r2)
assert_zero(rr)