logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1170428 - in /logging/log4net/trunk/tests/src/Appender: EventLogAppenderTest.cs RollingFileAppenderTest.cs
Date Wed, 14 Sep 2011 03:55:05 GMT
Author: bodewig
Date: Wed Sep 14 03:55:04 2011
New Revision: 1170428

URL: http://svn.apache.org/viewvc?rev=1170428&view=rev
Log:
EventLogAppender doesn't throw a SecurityException on Linux

Modified:
    logging/log4net/trunk/tests/src/Appender/EventLogAppenderTest.cs
    logging/log4net/trunk/tests/src/Appender/RollingFileAppenderTest.cs

Modified: logging/log4net/trunk/tests/src/Appender/EventLogAppenderTest.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/tests/src/Appender/EventLogAppenderTest.cs?rev=1170428&r1=1170427&r2=1170428&view=diff
==============================================================================
--- logging/log4net/trunk/tests/src/Appender/EventLogAppenderTest.cs (original)
+++ logging/log4net/trunk/tests/src/Appender/EventLogAppenderTest.cs Wed Sep 14 03:55:04 2011
@@ -79,7 +79,7 @@ namespace log4net.Tests.Appender
         /// ActivateOption tries to create an event source if it doesn't exist but this is
going to fail on more modern Windows versions unless the code is run with local administrator
privileges.
         /// </summary>
         [Test]
-        [Platform(Exclude = "Win2K,WinXP")]
+        [Platform(Exclude = "Win2K,WinXP", Include="Win")]
         public void ActivateOptionsDisablesAppenderIfSourceDoesntExist()
         {
             EventLogAppender eventAppender = new EventLogAppender();

Modified: logging/log4net/trunk/tests/src/Appender/RollingFileAppenderTest.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/tests/src/Appender/RollingFileAppenderTest.cs?rev=1170428&r1=1170427&r2=1170428&view=diff
==============================================================================
--- logging/log4net/trunk/tests/src/Appender/RollingFileAppenderTest.cs (original)
+++ logging/log4net/trunk/tests/src/Appender/RollingFileAppenderTest.cs Wed Sep 14 03:55:04
2011
@@ -62,17 +62,17 @@ namespace log4net.Tests.Appender
 
 			public void Error(string message)
 			{
-				m_buffer.Append(message + "\n");
+				m_buffer.Append(message + Environment.NewLine);
 			}
 
 			public void Error(string message, Exception e)
 			{
-				m_buffer.Append(message + "\n" + e.Message + "\n");
+				m_buffer.Append(message + Environment.NewLine + e.Message + Environment.NewLine);
 			}
 
 			public void Error(string message, Exception e, ErrorCode errorCode)
 			{
-				m_buffer.Append(message + "\n" + e.Message + "\n");
+				m_buffer.Append(message + Environment.NewLine + e.Message + Environment.NewLine);
 			}
 		}
 
@@ -498,16 +498,17 @@ namespace log4net.Tests.Appender
 			}
 		}
 
+		static readonly int s_LengthNL = Environment.NewLine.Length;
+
 		/// <summary>
 		/// Returns the number of bytes logged per message, including
-		/// any CR/LF characters in addition to the message length.
+		/// any newline characters in addition to the message length.
 		/// </summary>
 		/// <param name="sMessage"></param>
 		/// <returns></returns>
 		private static int TotalMessageLength(string sMessage)
 		{
-			const int iLengthCRLF = 2;
-			return sMessage.Length + iLengthCRLF;
+			return sMessage.Length + s_LengthNL;
 		}
 
 		/// <summary>
@@ -655,7 +656,7 @@ namespace log4net.Tests.Appender
 			}
 
 			/// <summary>
-			/// The length of a message, including any CR/LF characters.
+			/// The length of a message, including any newline characters.
 			/// This length assumes all messages are a fixed length for
 			/// test purposes.
 			/// </summary>



Mime
View raw message