path: root/test
diff options
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-25 11:06:57 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-25 11:06:57 +0000
commitbb41909d8b8c14045bcf08d75732337d6c972595 (patch)
treef7071e42f760ca35fc908817c6d2236bb184a6d0 /test
parentd711cde778c8fcfeb85371292e5306a0673b292a (diff)
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 <> Signed-off-by: URABE, Shyouhei <> git-svn-id: svn+ssh:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
1 files changed, 3 insertions, 2 deletions
diff --git a/test/test_syslog.rb b/test/test_syslog.rb
index b84d236..063d3b1 100644
--- a/test/test_syslog.rb
+++ b/test/test_syslog.rb
@@ -140,8 +140,9 @@ class TestSyslog < Test::Unit::TestCase
- # 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)