diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-18 01:48:47 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-18 01:48:47 +0000 |
commit | ea1a4f2929ab0cdb85b04c268e5d128f2c0a42c6 (patch) | |
tree | 0252ba3601d8706634c275c9c222825fc9db2786 /test/etc | |
parent | 63a23dc678361f9d3031141748d0ba6485516a54 (diff) |
* ext/etc/etc.c: Etc.sysconf, Etc.confstr and IO#pathconf implemented.
* ext/etc/extconf.rb: Check sysconf(), confstr() and fpathconf().
* ext/etc/mkconstants.rb: New file.
[ruby-core:62600] [Feature #9842]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/etc')
-rw-r--r-- | test/etc/test_etc.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/etc/test_etc.rb b/test/etc/test_etc.rb index 56fa4fbfbc..4c2b1f841d 100644 --- a/test/etc/test_etc.rb +++ b/test/etc/test_etc.rb @@ -125,4 +125,38 @@ class TestEtc < Test::Unit::TestCase assert_kind_of(String, uname[sym]) } end + + def test_sysconf + begin + Etc.sysconf + rescue NotImplementedError + return + rescue ArgumentError + end + assert_kind_of(Integer, Etc.sysconf(Etc::SC_CLK_TCK)) + end + + def test_confstr + begin + Etc.confstr + rescue NotImplementedError + return + rescue ArgumentError + end + assert_kind_of(String, Etc.confstr(Etc::CS_PATH)) + end + + def test_pathconf + begin + Etc.confstr + rescue NotImplementedError + return + rescue ArgumentError + end + IO.pipe {|r, w| + val = r.pathconf(Etc::PC_PIPE_BUF) + assert(val.nil? || val.kind_of?(Integer)) + } + end + end |