summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-29 22:48:42 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-29 22:48:42 +0000
commit5b66b692dde7cf64e06216aefdb76748d5f33377 (patch)
tree48187f28fbbc974d7704501926d107a637299a27 /test
parenta7fb5151464fddaad13c9fae922ba534ac9b125a (diff)
merges r31177,r31178 and r31179 from trunk into ruby_1_9_2.
-- Use LOG_PID instead of LOG_PERROR in Syslog.open test LOG_PERROR isn't a POSIX option for syslog, so it fails on platforms that don't define it. Solaris 9 and 10 are examples of this. Use LOG_PID instead. Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca> Signed-off-by: URABE, Shyouhei <shyouhei@ruby-lang.org> -- Skip syslog tests that rely on LOG_PERROR unless it's defined Instead of checking looking at the platform to determine if the tests relying on LOG_PERROR should be run, look for the definition of the constant as this will be robust against all platforms as long as the underlying syslog.c code sets it up correctly. This specifically addresses failures on Solaris 9. Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca> Signed-off-by: URABE, Shyouhei <shyouhei@ruby-lang.org> -- ChangeLog for it git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/test_syslog.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/test_syslog.rb b/test/test_syslog.rb
index e9fc375c90..375ff2fe30 100644
--- a/test/test_syslog.rb
+++ b/test/test_syslog.rb
@@ -43,10 +43,11 @@ class TestSyslog < Test::Unit::TestCase
Syslog.close
# given parameters
- Syslog.open("foo", Syslog::LOG_NDELAY | Syslog::LOG_PERROR, Syslog::LOG_DAEMON)
+ options = Syslog::LOG_NDELAY | Syslog::LOG_PID
+ Syslog.open("foo", options, Syslog::LOG_DAEMON)
assert_equal('foo', Syslog.ident)
- assert_equal(Syslog::LOG_NDELAY | Syslog::LOG_PERROR, Syslog.options)
+ assert_equal(options, Syslog.options)
assert_equal(Syslog::LOG_DAEMON, Syslog.facility)
Syslog.close
@@ -134,8 +135,9 @@ class TestSyslog < Test::Unit::TestCase
stderr[1].close
Process.waitpid(pid)
- # LOG_PERROR is not yet implemented on Cygwin.
- return if RUBY_PLATFORM =~ /cygwin/
+ # LOG_PERROR is not implemented on Cygwin or Solaris. Only test
+ # these on systems that define it.
+ return unless Syslog.const_defined?(:LOG_PERROR)
2.times {
assert_equal("syslog_test: test1 - hello, world!\n", stderr[0].gets)