You've already forked linux-packaging-mono
Imported Upstream version 4.3.2.467
Former-commit-id: 9c2cb47f45fa221e661ab616387c9cda183f283d
This commit is contained in:
@@ -133,8 +133,12 @@ namespace System.Configuration {
|
||||
rootGroup.StreamName = streamName;
|
||||
}
|
||||
|
||||
if (streamName != null)
|
||||
Load ();
|
||||
try {
|
||||
if (streamName != null)
|
||||
Load ();
|
||||
} catch (XmlException ex) {
|
||||
throw new ConfigurationErrorsException (ex.Message, ex, streamName, 0);
|
||||
}
|
||||
}
|
||||
|
||||
internal Configuration Parent {
|
||||
|
||||
@@ -627,5 +627,23 @@ namespace MonoTests.System.Configuration {
|
||||
Assert.AreEqual ("Server=(local);Initial Catalog=someDb;User Id=someUser;Password=somePassword;Application Name=someAppName;Min Pool Size=5;Max Pool Size=500;Connect Timeout=10;Connection Lifetime=29;",
|
||||
connString);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BadConfig ()
|
||||
{
|
||||
string xml = @" badXml";
|
||||
|
||||
var file = Path.Combine (tempFolder, "badConfig.config");
|
||||
File.WriteAllText (file, xml);
|
||||
|
||||
try {
|
||||
var fileMap = new ConfigurationFileMap (file);
|
||||
var configuration = ConfigurationManager.OpenMappedMachineConfiguration (fileMap);
|
||||
Assert.Fail ("Exception ConfigurationErrorsException was expected.");
|
||||
} catch (ConfigurationErrorsException e) {
|
||||
Assert.AreEqual (file, e.Filename);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,27 +143,15 @@ namespace MonoTests.System.Configuration {
|
||||
{
|
||||
ConfigurationPermission p = new ConfigurationPermission (PermissionState.Unrestricted);
|
||||
|
||||
#if NET_4_0
|
||||
Assert.AreEqual(
|
||||
"<IPermission class=\"System.Configuration.ConfigurationPermission, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"\nversion=\"1\"\nUnrestricted=\"true\"/>\n",
|
||||
p.ToString().Replace ("\r\n", "\n"), "A1");
|
||||
#else
|
||||
Assert.AreEqual (
|
||||
"<IPermission class=\"System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"\nversion=\"1\"\nUnrestricted=\"true\"/>\n",
|
||||
p.ToString ().Replace ("\r\n", "\n"), "A1");
|
||||
#endif
|
||||
|
||||
p = new ConfigurationPermission (PermissionState.None);
|
||||
|
||||
#if NET_4_0
|
||||
Assert.AreEqual (
|
||||
"<IPermission class=\"System.Configuration.ConfigurationPermission, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"\nversion=\"1\"/>\n",
|
||||
p.ToString().Replace ("\r\n", "\n"), "A2");
|
||||
#else
|
||||
Assert.AreEqual (
|
||||
"<IPermission class=\"System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"\nversion=\"1\"/>\n",
|
||||
p.ToString ().Replace ("\r\n", "\n"), "A2");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,18 +64,6 @@ namespace MonoTests.System.Configuration.Util {
|
||||
}
|
||||
}
|
||||
|
||||
public static string DotNetVersion {
|
||||
get {
|
||||
#if NET_4_5
|
||||
return "net_4_5";
|
||||
#elif NET_4_0
|
||||
return "net_4_0";
|
||||
#else
|
||||
return "net_2_0";
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
public static string ThisDllName {
|
||||
get {
|
||||
var asm = Assembly.GetCallingAssembly ();
|
||||
|
||||
Reference in New Issue
Block a user