From 076a82105af546c139014b58cf8995c548121681 Mon Sep 17 00:00:00 2001 From: ttate Date: Fri, 26 Apr 2002 07:03:32 +0000 Subject: 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 --- ext/dl/test/test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'ext/dl/test') 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 -- cgit v1.2.3