[前][次][番号順一覧][スレッド一覧]

ruby-changes:19750

From: yugui <ko1@a...>
Date: Mon, 30 May 2011 07:53:30 +0900 (JST)
Subject: [ruby-changes:19750] yugui:r31793 (ruby_1_9_2): merges r31177,r31178 and r31179 from trunk into ruby_1_9_2.

yugui	2011-05-30 07:48:42 +0900 (Mon, 30 May 2011)

  New Revision: 31793

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31793

  Log:
    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@a...>
    Signed-off-by: URABE, Shyouhei <shyouhei@r...>
    --
    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@a...>
    Signed-off-by: URABE, Shyouhei <shyouhei@r...>
    --
    ChangeLog for it

  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/test/test_syslog.rb
    branches/ruby_1_9_2/version.h

Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 31792)
+++ ruby_1_9_2/ChangeLog	(revision 31793)
@@ -1,3 +1,22 @@
+Fri Mar 25 19:39:40 2011  Ben Walton <bwalton@a...>
+
+	* test/test_syslog.rb:
+	  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.
+
+	  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.
+
 Thu Mar 24 11:36:55 2011  NARUSE, Yui  <naruse@r...>
 
 	* ext/openssl/ossl_x509name.c: id_aref's type is ID.
Index: ruby_1_9_2/version.h
===================================================================
--- ruby_1_9_2/version.h	(revision 31792)
+++ ruby_1_9_2/version.h	(revision 31793)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 220
+#define RUBY_PATCHLEVEL 221
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1
Index: ruby_1_9_2/test/test_syslog.rb
===================================================================
--- ruby_1_9_2/test/test_syslog.rb	(revision 31792)
+++ ruby_1_9_2/test/test_syslog.rb	(revision 31793)
@@ -43,10 +43,11 @@
     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 @@
     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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]