Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -387,9 +387,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
[Test]
[EnvironmentPermission (SecurityAction.Deny, Unrestricted = true)]
[ExpectedException (typeof (SecurityException))]
#if ONLY_1_1
[Category ("NotDotNet")] // MS doesn't check for Environment under 1.x
#endif
public void FromDom_Deny_Environment ()
{
CodeCompilerTest cc = new CodeCompilerTest ();
@@ -428,9 +425,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
[Test]
[EnvironmentPermission (SecurityAction.Deny, Unrestricted = true)]
[ExpectedException (typeof (SecurityException))]
#if ONLY_1_1
[Category ("NotDotNet")] // MS doesn't check for Environment under 1.x
#endif
public void FromDomBatch_Deny_Environment ()
{
CodeCompilerTest cc = new CodeCompilerTest ();
@@ -469,9 +463,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
[Test]
[EnvironmentPermission (SecurityAction.Deny, Unrestricted = true)]
[ExpectedException (typeof (SecurityException))]
#if ONLY_1_1
[Category ("NotDotNet")] // MS doesn't check for Environment under 1.x
#endif
public void FromFile_Deny_Environment ()
{
CodeCompilerTest cc = new CodeCompilerTest ();
@@ -510,9 +501,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
[Test]
[EnvironmentPermission (SecurityAction.Deny, Unrestricted = true)]
[ExpectedException (typeof (SecurityException))]
#if ONLY_1_1
[Category ("NotDotNet")] // MS doesn't check for Environment under 1.x
#endif
public void FromFileBatch_Deny_Environment ()
{
CodeCompilerTest cc = new CodeCompilerTest ();
@@ -551,9 +539,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
[Test]
[EnvironmentPermission (SecurityAction.Deny, Unrestricted = true)]
[ExpectedException (typeof (SecurityException))]
#if ONLY_1_1
[Category ("NotDotNet")] // MS doesn't check for Environment under 1.x
#endif
public void FromSource_Deny_Environment ()
{
CodeCompilerTest cc = new CodeCompilerTest ();
@@ -592,9 +577,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
[Test]
[EnvironmentPermission (SecurityAction.Deny, Unrestricted = true)]
[ExpectedException (typeof (SecurityException))]
#if ONLY_1_1
[Category ("NotDotNet")] // MS doesn't check for Environment under 1.x
#endif
public void FromSourceBatch_Deny_Environment ()
{
CodeCompilerTest cc = new CodeCompilerTest ();
@@ -618,9 +600,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
[Test]
[EnvironmentPermission (SecurityAction.Deny, Unrestricted = true)]
[ExpectedException (typeof (SecurityException))]
#if ONLY_1_1
[Category ("NotDotNet")] // MS doesn't check for Environment under 1.x
#endif
public void GetResponseFileCmdArgs_Deny_Environment ()
{
CodeCompilerTest cc = new CodeCompilerTest ();

View File

@@ -92,7 +92,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
Assert.IsNull (cdp.CreateGenerator (writer), "CreateGenerator(TextWriter)");
Assert.IsNull (cdp.CreateParser (), "CreateParser()");
Assert.IsNotNull (cdp.GetConverter (typeof (string)), "GetConverter");
#if NET_2_0
Assert.IsNotNull (CodeDomProvider.GetAllCompilerInfo (), "GetAllCompilerInfo");
// mono returns null (missing config?)
@@ -101,10 +100,8 @@ namespace MonoCasTests.System.CodeDom.Compiler {
Assert.IsFalse (CodeDomProvider.IsDefinedExtension (String.Empty), "String.Empty");
Assert.IsFalse (CodeDomProvider.IsDefinedLanguage (String.Empty), "String.Empty");
#endif
}
#if NET_2_0
[Test]
[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
[ExpectedException (typeof (NotImplementedException))]
@@ -333,7 +330,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
Assert.IsFalse ((bool) mi.Invoke (null, new object[1] { String.Empty }), "IsDefinedLanguage('')");
// requires full trust (i.e. unrestricted permission set)
}
#endif
[Test]
[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
public void LinkDemand_Deny_Unrestricted ()

View File

@@ -279,9 +279,7 @@ namespace MonoCasTests.System.CodeDom.Compiler {
public void TestProtectedProperties ()
{
#if NET_2_0
Assert.IsNull (CurrentClass, "CurrentClass");
#endif
Assert.IsNull (CurrentMember, "CurrentMember");
Assert.AreEqual ("<% unknown %>", CurrentMemberName, "CurrentMemberName");
Assert.AreEqual ("<% unknown %>", CurrentTypeName, "CurrentTypeName");
@@ -350,22 +348,18 @@ namespace MonoCasTests.System.CodeDom.Compiler {
}
catch (NullReferenceException) {
}
#if NET_2_0
try {
GenerateDefaultValueExpression (null);
}
catch (NotImplementedException) {
// both mono & ms
}
#endif
try {
GenerateDirectionExpression (null);
}
catch (NullReferenceException) {
}
#if NET_2_0
GenerateDirectives (null);
#endif
try {
GenerateDoubleValue (Double.MaxValue);
}
@@ -539,7 +533,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
Assert.Ignore ("SecurityManager.SecurityEnabled is OFF");
}
#if NET_2_0
[Test]
[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
public void Public ()
@@ -552,7 +545,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
// mono
}
}
#endif
[Test]
[PermissionSet (SecurityAction.Deny, Unrestricted = true)]

View File

@@ -184,10 +184,8 @@ namespace MonoTests.System.CodeDom.Compiler
[Test]
public abstract void EntryPointMethodTest ();
#if NET_2_0
[Test]
public abstract void PartialTypeTest ();
#endif
protected string GenerateDefaultType (CodeGeneratorOptions options)
{
@@ -1109,7 +1107,6 @@ namespace MonoTests.System.CodeDom.Compiler
return GenerateCodeFromType (TypeDeclaration, options);
}
#if NET_2_0
protected string GenerateGenericCodeTypeReferences (CodeGeneratorOptions options)
{
CodeTypeDeclaration td = new CodeTypeDeclaration ("Test");
@@ -1131,6 +1128,5 @@ namespace MonoTests.System.CodeDom.Compiler
TypeDeclaration.IsPartial = true;
return GenerateCodeFromType (TypeDeclaration, options);
}
#endif
}
}

View File

@@ -45,16 +45,12 @@ namespace MonoTests.System.CodeDom.Compiler {
Assert.AreEqual ("Block", cgo.BracingStyle, "BracingStyle");
Assert.IsFalse (cgo.ElseOnClosing, "ElseOnClosing");
Assert.AreEqual (" ", cgo.IndentString, "IndentString");
#if NET_2_0
Assert.IsFalse (cgo.VerbatimOrder, "VerbatimOrder");
#endif
Assert.IsNull (cgo["BlankLinesBetweenMembers"], "this[BlankLinesBetweenMembers]");
Assert.IsNull (cgo["BracingStyle"], "this[BracingStyle]");
Assert.IsNull (cgo["ElseOnClosing"], "this[ElseOnClosing]");
Assert.IsNull (cgo["IndentString"], "this[IndentString]");
#if NET_2_0
Assert.IsNull (cgo["VerbatimOrder"], "this[VerbatimOrder]");
#endif
}
[Test]
@@ -70,10 +66,8 @@ namespace MonoTests.System.CodeDom.Compiler {
Assert.IsNotNull (cgo["ElseOnClosing"], "this[ElseOnClosing]");
cgo.IndentString = cgo.IndentString;
Assert.IsNotNull (cgo["IndentString"], "this[IndentString]");
#if NET_2_0
cgo.VerbatimOrder = cgo.VerbatimOrder;
Assert.IsNotNull (cgo["VerbatimOrder"], "this[VerbatimOrder]");
#endif
}
[Test]
@@ -99,12 +93,10 @@ namespace MonoTests.System.CodeDom.Compiler {
Assert.AreEqual ("\t", cgo.IndentString, "IndentString-1");
cgo["IndentString"] = null;
Assert.AreEqual (" ", cgo.IndentString, "IndentString-2");
#if NET_2_0
cgo.VerbatimOrder = true;
Assert.IsTrue (cgo.VerbatimOrder, "VerbatimOrder-1");
cgo["VerbatimOrder"] = null;
Assert.IsFalse (cgo.VerbatimOrder, "VerbatimOrder-2");
#endif
}
}
}

View File

@@ -425,7 +425,6 @@ namespace MonoTests.System.CodeDom.Compiler
return value;
}
#if NET_2_0
protected override void GenerateDirectives (CodeDirectiveCollection directives)
{
foreach (CodeDirective d in directives) {
@@ -444,7 +443,6 @@ namespace MonoTests.System.CodeDom.Compiler
}
}
}
#endif
#endregion Override implementation of CodeGenerator
}

View File

@@ -100,9 +100,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
[Test]
[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
#if ONLY_1_1
[ExpectedException (typeof (SecurityException))]
#endif
public void LinkDemand_Deny_Unrestricted ()
{
ConstructorInfo ci = typeof (CompilerError).GetConstructor (new Type [0]);

View File

@@ -121,9 +121,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
[Test]
[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
#if ONLY_1_1
[ExpectedException (typeof (SecurityException))]
#endif
public void LinkDemand_Deny_Unrestricted ()
{
ConstructorInfo ci = typeof (CompilerErrorCollection).GetConstructor (new Type[0]);

View File

@@ -27,7 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using NUnit.Framework;
@@ -120,4 +119,3 @@ namespace MonoCasTests.System.CodeDom.Compiler {
}
}
#endif

View File

@@ -76,10 +76,8 @@ namespace MonoCasTests.System.CodeDom.Compiler {
cp.WarningLevel = 0;
Assert.IsNull (cp.Win32Resource, "Win32Resource");
cp.Win32Resource = "*";
#if NET_2_0
Assert.AreEqual (0, cp.EmbeddedResources.Count, "EmbeddedResources");
Assert.AreEqual (0, cp.LinkedResources.Count, "LinkedResources");
#endif
}
[Test]
@@ -109,10 +107,8 @@ namespace MonoCasTests.System.CodeDom.Compiler {
cp.WarningLevel = 0;
Assert.IsNull (cp.Win32Resource, "Win32Resource");
cp.Win32Resource = "*";
#if NET_2_0
Assert.AreEqual (0, cp.EmbeddedResources.Count, "EmbeddedResources");
Assert.AreEqual (0, cp.LinkedResources.Count, "LinkedResources");
#endif
}
[Test]
@@ -142,10 +138,8 @@ namespace MonoCasTests.System.CodeDom.Compiler {
cp.WarningLevel = 0;
Assert.IsNull (cp.Win32Resource, "Win32Resource");
cp.Win32Resource = "*";
#if NET_2_0
Assert.AreEqual (0, cp.EmbeddedResources.Count, "EmbeddedResources");
Assert.AreEqual (0, cp.LinkedResources.Count, "LinkedResources");
#endif
}
[Test]
@@ -175,10 +169,8 @@ namespace MonoCasTests.System.CodeDom.Compiler {
cp.WarningLevel = 0;
Assert.IsNull (cp.Win32Resource, "Win32Resource");
cp.Win32Resource = "*";
#if NET_2_0
Assert.AreEqual (0, cp.EmbeddedResources.Count, "EmbeddedResources");
Assert.AreEqual (0, cp.LinkedResources.Count, "LinkedResources");
#endif
}
[Test]

View File

@@ -74,11 +74,7 @@ namespace MonoTests.System.CodeDom.Compiler
[TestFixtureTearDown]
public void FixtureTearDown ()
{
#if NET_2_0
winid.Dispose ();
#else
GC.KeepAlive (winid);
#endif
}
[Test]

View File

@@ -27,7 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using NUnit.Framework;
@@ -71,4 +70,3 @@ namespace MonoCasTests.System.CodeDom.Compiler {
}
}
#endif

View File

@@ -27,7 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using NUnit.Framework;
@@ -65,4 +64,3 @@ namespace MonoTests.System.CodeDom.Compiler {
}
}
#endif

View File

@@ -136,9 +136,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
[Test]
[EnvironmentPermission (SecurityAction.Deny, Read = "Mono")]
[ExpectedException (typeof (SecurityException))]
#if ONLY_1_1
[Category ("NotDotNet")] // MS doesn't check for Environment under 1.x
#endif
public void BasePath_Deny_EnvironmentPermission ()
{
TempFileCollection tfc = new TempFileCollection ();
@@ -149,9 +146,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
[Test]
[FileIOPermission (SecurityAction.PermitOnly, Unrestricted = true)]
[ExpectedException (typeof (SecurityException))]
#if ONLY_1_1
[Category ("NotDotNet")] // MS doesn't check for Environment under 1.x
#endif
public void BasePath_PermitOnly_FileIOPermission ()
{
TempFileCollection tfc = new TempFileCollection ();
@@ -182,9 +176,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
[Test]
[EnvironmentPermission (SecurityAction.Deny, Read = "Mono")]
[ExpectedException (typeof (SecurityException))]
#if ONLY_1_1
[Category ("NotDotNet")] // MS doesn't check for Environment under 1.x
#endif
public void AddExtension_Deny_EnvironmentPermission ()
{
TempFileCollection tfc = new TempFileCollection ();
@@ -195,9 +186,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
[Test]
[FileIOPermission (SecurityAction.PermitOnly, Unrestricted = true)]
[ExpectedException (typeof (SecurityException))]
#if ONLY_1_1
[Category ("NotDotNet")] // MS doesn't check for Environment under 1.x
#endif
public void AddExtension_PermitOnly_FileIOPermission ()
{
TempFileCollection tfc = new TempFileCollection ();
@@ -228,9 +216,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
[Test]
[EnvironmentPermission (SecurityAction.Deny, Read = "Mono")]
[ExpectedException (typeof (SecurityException))]
#if ONLY_1_1
[Category ("NotDotNet")] // MS doesn't check for Environment under 1.x
#endif
public void AddExtension2_Deny_EnvironmentPermission ()
{
TempFileCollection tfc = new TempFileCollection ();
@@ -241,9 +226,6 @@ namespace MonoCasTests.System.CodeDom.Compiler {
[Test]
[FileIOPermission (SecurityAction.PermitOnly, Unrestricted = true)]
[ExpectedException (typeof (SecurityException))]
#if ONLY_1_1
[Category ("NotDotNet")] // MS doesn't check for Environment under 1.x
#endif
public void AddExtension2_PermitOnly_FileIOPermission ()
{
TempFileCollection tfc = new TempFileCollection ();