Imported Upstream version 5.0.0.42

Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-04-10 11:41:01 +00:00
parent 1190d13a04
commit 6bdd276d05
19939 changed files with 3099680 additions and 93811 deletions

View File

@@ -10,6 +10,7 @@ LIB_REFS = secxml/System bare/System.Xml System.Security
LIB_MCS_FLAGS = -nowarn:618
TEST_MCS_FLAGS =
TEST_LIB_REFS = System.Xml System
TEST_NUNITLITE_APP_CONFIG_GLOBAL=Test/test-config-file
include ../../build/library.make
@@ -20,6 +21,9 @@ configuration_library_deps = \
$(build_lib): $(configuration_library_deps)
test-local:
cp Test/appSettings.config $(dir $(NUNITLITE_CONFIG_FILE))/Test-appSettings.config
.NOTPARALLEL: $(configuration_library_deps)
$(secxml_libdir)/System.dll:

View File

@@ -84,8 +84,10 @@ namespace System.Configuration
get { return isDesignTime; }
}
#pragma warning disable 67
public event InternalConfigEventHandler ConfigChanged;
public event InternalConfigEventHandler ConfigRemoved;
#pragma warning restore 67
}
}

View File

@@ -65,9 +65,9 @@ namespace MonoTests.System.Configuration
{
Directory.SetCurrentDirectory (tempFolder);
var currentAssembly = Assembly.GetExecutingAssembly ().Location;
var currentAssembly = TestUtil.ThisApplicationPath;
var config = ConfigurationManager.OpenExeConfiguration (currentAssembly);
Assert.AreEqual ("Test/appSettings.config", config.AppSettings.File, "#A01");
Assert.AreEqual ("Test-appSettings.config", config.AppSettings.File, "#A01");
Assert.AreEqual ("foo", ConfigurationSettings.AppSettings["TestKey1"], "#A02");
Assert.AreEqual ("bar", ConfigurationSettings.AppSettings["TestKey2"], "#A03");
}

View File

@@ -257,10 +257,9 @@ namespace MonoTests.System.Configuration {
[Test]
public void exePath_UserLevelNone ()
{
string basedir = AppDomain.CurrentDomain.BaseDirectory;
string name = TestUtil.ThisDllName;
string name = TestUtil.ThisApplicationPath;
SysConfig config = ConfigurationManager.OpenExeConfiguration (name);
Assert.AreEqual (Path.Combine (basedir, name + ".config"), config.FilePath);
Assert.AreEqual (TestUtil.ThisApplicationPath + ".config", config.FilePath);
}
[Test]
@@ -615,11 +614,6 @@ namespace MonoTests.System.Configuration {
[Test]
public void TestConnectionStringRetrieval ()
{
var currentAssembly = Assembly.GetExecutingAssembly().Location;
Assert.IsTrue (File.Exists (currentAssembly + ".config"),
String.Format ("This test cannot succeed without the .config file being in the same place as the assembly ({0})",
currentAssembly));
var connStringObj = ConfigurationManager.ConnectionStrings ["test-connstring"];
Assert.IsNotNull (connStringObj);
var connString = connStringObj.ConnectionString;

View File

@@ -37,7 +37,6 @@ using SysConfig = System.Configuration.Configuration;
using NUnit.Framework;
using NUnit.Framework.Constraints;
using NUnit.Framework.SyntaxHelpers;
namespace MonoTests.System.Configuration {
using Util;

View File

@@ -64,17 +64,16 @@ namespace MonoTests.System.Configuration.Util {
}
}
public static string ThisDllName {
public static string ThisApplicationPath {
get {
var asm = Assembly.GetCallingAssembly ();
return Path.GetFileName (asm.Location);
var asm = Assembly.GetEntryAssembly ();
return asm.Location;
}
}
public static string ThisConfigFileName {
get {
var asm = Assembly.GetCallingAssembly ();
var exe = Path.GetFileName (asm.Location);
var exe = Path.GetFileName (ThisApplicationPath);
return exe + ".config";
}
}