summaryrefslogtreecommitdiff
path: root/test/socket/test_ancdata.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-28 09:29:26 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-28 09:29:26 +0000
commit2ba6eec1fa50cacaff647525358fd93c7c862a27 (patch)
treee378059c80a7e05837ce341f7bccc2178a978356 /test/socket/test_ancdata.rb
parent8746e342bc3b45ec7d14df09d1288a9b53f225f0 (diff)
* ext/socket/ancdata.c (ancillary_unix_rights): check message type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/socket/test_ancdata.rb')
-rw-r--r--test/socket/test_ancdata.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/socket/test_ancdata.rb b/test/socket/test_ancdata.rb
index 0c1029f1d6..112b0c9e58 100644
--- a/test/socket/test_ancdata.rb
+++ b/test/socket/test_ancdata.rb
@@ -55,4 +55,12 @@ class TestSocketAncData < Test::Unit::TestCase
assert(!ancdata.cmsg_is?(:IP, :PKTINFO))
end
end
+
+ if defined?(Socket::SCM_RIGHTS) && defined?(Socket::SCM_TIMESTAMP)
+ def test_unix_rights
+ assert_raise(TypeError) {
+ Socket::AncillaryData.int(:UNIX, :SOL_SOCKET, :TIMESTAMP, 1).unix_rights
+ }
+ end
+ end
end if defined? Socket::AncillaryData