logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1165680 - /logging/log4net/trunk/tests/src/Util/EnvironmentPatternConverterTest.cs
Date Tue, 06 Sep 2011 14:19:44 GMT
Author: bodewig
Date: Tue Sep  6 14:19:44 2011
New Revision: 1165680

URL: http://svn.apache.org/viewvc?rev=1165680&view=rev
Log:
skip test that tries to set a system level environment variable if user lacks the permission
to set it.  LOG4NET-301

Modified:
    logging/log4net/trunk/tests/src/Util/EnvironmentPatternConverterTest.cs

Modified: logging/log4net/trunk/tests/src/Util/EnvironmentPatternConverterTest.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/tests/src/Util/EnvironmentPatternConverterTest.cs?rev=1165680&r1=1165679&r2=1165680&view=diff
==============================================================================
--- logging/log4net/trunk/tests/src/Util/EnvironmentPatternConverterTest.cs (original)
+++ logging/log4net/trunk/tests/src/Util/EnvironmentPatternConverterTest.cs Tue Sep  6 14:19:44
2011
@@ -42,7 +42,12 @@ namespace log4net.Tests.Util
         public void SystemLevelEnvironmentVariable()
         {
             EnvironmentPatternConverter converter = new EnvironmentPatternConverter();
-            Environment.SetEnvironmentVariable(ENVIRONMENT_VARIABLE_NAME, SYSTEM_LEVEL_VALUE,
EnvironmentVariableTarget.Machine);
+            try {
+                Environment.SetEnvironmentVariable(ENVIRONMENT_VARIABLE_NAME, SYSTEM_LEVEL_VALUE,
EnvironmentVariableTarget.Machine);
+            }
+            catch (System.Security.SecurityException) {
+                Assert.Ignore("Test skipped as current user must not set system level environment
variables");
+            }
 
             converter.Option = ENVIRONMENT_VARIABLE_NAME;
 



Mime
View raw message