summaryrefslogtreecommitdiff
path: root/ext/dl/test/test.rb
diff options
context:
space:
mode:
authorttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-26 07:03:32 +0000
committerttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-26 07:03:32 +0000
commit076a82105af546c139014b58cf8995c548121681 (patch)
tree1f1ae3c305f3d89d02c6caffd12fc0c275b8e5ef /ext/dl/test/test.rb
parentcc3b6901b2178ef82dc4b05416e6c0cb0e0e3d46 (diff)
ext/dl/ptr.c: missing break in switch statements.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/test/test.rb')
-rw-r--r--ext/dl/test/test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/dl/test/test.rb b/ext/dl/test/test.rb
index cd63ff190e..e6a7f33623 100644
--- a/ext/dl/test/test.rb
+++ b/ext/dl/test/test.rb
@@ -264,6 +264,7 @@ assert("data_aref", :must,
ptr["name"].collect{|c| c.chr}.join.split("\0")[0] == "name2")
assert("data_aref", :must,
ptr["name"].collect{|c| c.chr}.join.split("\0")[0] == "name2") unless (Fixnum === :-)
+
ptr = ptr["next"]
ptr.struct!("C1024P", :name, :next)
assert("data_aref", :must,
@@ -272,3 +273,17 @@ assert("data_aref", :must,
ptr["name"].collect{|c| c.chr}.join.split("\0")[0] == "name1") unless (Fixnum === :-)
GC.start
+
+ptr = DL::malloc(1024)
+ptr.struct!("CHIL", "c", "h", "i", "l")
+ptr["c"] = 1
+ptr["h"] = 2
+ptr["i"] = 3
+ptr["l"] = 4
+assert("struct!", :must,
+ ptr["c"] == 1 &&
+ ptr["h"] == 2 &&
+ ptr["i"] == 3 &&
+ ptr["l"] == 4)
+
+GC.start