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

@@ -65,7 +65,6 @@ namespace MonoCasTests.Microsoft.CSharp {
catch (NotImplementedException) {
// mono
}
#if NET_2_0
CodeTypeMember ctm = new CodeTypeMember ();
StringWriter sw = new StringWriter ();
CodeGeneratorOptions cgo = new CodeGeneratorOptions ();
@@ -75,7 +74,6 @@ namespace MonoCasTests.Microsoft.CSharp {
catch (NotImplementedException) {
// mono
}
#endif
}
// LinkDemand

View File

@@ -80,13 +80,11 @@ namespace MonoTests.Microsoft.CSharp
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.StaticConstructors), "#20");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.TryCatchStatements), "#21");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.Win32Resources), "#22");
#if NET_2_0
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.DeclareIndexerProperties), "#23");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.GenericTypeDeclaration), "#24");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.GenericTypeReference), "#25");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.PartialTypes), "#26");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.Resources), "#27");
#endif
}
[Test]
@@ -106,9 +104,7 @@ namespace MonoTests.Microsoft.CSharp
options.GenerateExecutable = false;
options.GenerateInMemory = true;
options.TempFiles = new TempFileCollection (_tempDir);
#if NET_2_0
options.EmbeddedResources.Add (sourceFile);
#endif
ICodeCompiler compiler = _codeProvider.CreateCompiler ();
CompilerResults results = compiler.CompileAssemblyFromFile (options,
@@ -129,7 +125,6 @@ namespace MonoTests.Microsoft.CSharp
Assert.AreEqual (1, tempFiles.Length, "#5");
Assert.AreEqual (sourceFile, tempFiles[0], "#6");
#if NET_2_0
string[] resources = compiledAssembly.GetManifestResourceNames();
Assert.IsNotNull (resources, "#7");
Assert.AreEqual (1, resources.Length, "#8");
@@ -141,7 +136,6 @@ namespace MonoTests.Microsoft.CSharp
Assert.IsNull (info.FileName, "#13");
Assert.IsNull (info.ReferencedAssembly, "#14");
Assert.AreEqual ((ResourceLocation.Embedded | ResourceLocation.ContainedInManifestFile), info.ResourceLocation, "#15");
#endif
}
[Test]
@@ -171,10 +165,8 @@ namespace MonoTests.Microsoft.CSharp
options.GenerateInMemory = true;
options.OutputAssembly = string.Empty;
options.TempFiles = new TempFileCollection (_tempDir);
#if NET_2_0
options.EmbeddedResources.Add (sourceFile1);
options.LinkedResources.Add (sourceFile2);
#endif
ICodeCompiler compiler = _codeProvider.CreateCompiler ();
CompilerResults results = compiler.CompileAssemblyFromFileBatch (options,
@@ -202,7 +194,6 @@ namespace MonoTests.Microsoft.CSharp
Assert.IsTrue (File.Exists (sourceFile1), "#C2");
Assert.IsTrue (File.Exists (sourceFile2), "#C3");
#if NET_2_0
string[] resources = compiledAssembly.GetManifestResourceNames();
Assert.IsNotNull (resources, "#D1");
Assert.AreEqual (2, resources.Length, "#D2");
@@ -233,7 +224,6 @@ namespace MonoTests.Microsoft.CSharp
Assert.AreEqual ("file2.cs", info.FileName, "#F6");
Assert.IsNull (info.ReferencedAssembly, "#F7");
Assert.AreEqual ((ResourceLocation) 0, info.ResourceLocation, "#F8");
#endif
}
[Test]
@@ -262,10 +252,8 @@ namespace MonoTests.Microsoft.CSharp
options.GenerateExecutable = false;
options.GenerateInMemory = true;
options.TempFiles = new TempFileCollection (_tempDir);
#if NET_2_0
options.EmbeddedResources.Add (sourceFile1);
options.LinkedResources.Add (sourceFile2);
#endif
ICodeCompiler compiler = _codeProvider.CreateCompiler ();
CompilerResults results = compiler.CompileAssemblyFromFileBatch (options,
@@ -293,7 +281,6 @@ namespace MonoTests.Microsoft.CSharp
Assert.IsTrue (File.Exists (sourceFile1), "#C2");
Assert.IsTrue (File.Exists (sourceFile2), "#C3");
#if NET_2_0
string[] resources = compiledAssembly.GetManifestResourceNames();
Assert.IsNotNull (resources, "#D1");
Assert.AreEqual (2, resources.Length, "#D2");
@@ -324,7 +311,6 @@ namespace MonoTests.Microsoft.CSharp
Assert.AreEqual ("file2.cs", info.FileName, "#F6");
Assert.IsNull (info.ReferencedAssembly, "#F7");
Assert.AreEqual ((ResourceLocation) 0, info.ResourceLocation, "#F8");
#endif
}
[Test]

View File

@@ -97,7 +97,6 @@ namespace MonoTests.Microsoft.CSharp
sb.Length = 0;
Assert.AreEqual ("void", Generate (new CodeTypeReferenceExpression (""), sw), "#10");
sb.Length = 0;
#if NET_2_0
Assert.AreEqual ("byte", Generate (new CodeTypeReferenceExpression (typeof (byte)), sw), "#11");
sb.Length = 0;
Assert.AreEqual ("decimal", Generate (new CodeTypeReferenceExpression (typeof (decimal)), sw), "#12");
@@ -114,24 +113,6 @@ namespace MonoTests.Microsoft.CSharp
sb.Length = 0;
Assert.AreEqual ("float", Generate (new CodeTypeReferenceExpression (typeof (float)), sw), "#18");
sb.Length = 0;
#else
Assert.AreEqual (typeof (byte).FullName, Generate (new CodeTypeReferenceExpression (typeof (byte)), sw), "#19");
sb.Length = 0;
Assert.AreEqual (typeof (decimal).FullName, Generate (new CodeTypeReferenceExpression (typeof (decimal)), sw), "#20");
sb.Length = 0;
Assert.AreEqual (typeof (double).FullName, Generate (new CodeTypeReferenceExpression (typeof (double)), sw), "#21");
sb.Length = 0;
Assert.AreEqual (typeof (sbyte).FullName, Generate (new CodeTypeReferenceExpression (typeof (sbyte)), sw), "#22");
sb.Length = 0;
Assert.AreEqual (typeof (ushort).FullName, Generate (new CodeTypeReferenceExpression (typeof (ushort)), sw), "#23");
sb.Length = 0;
Assert.AreEqual (typeof (uint).FullName, Generate (new CodeTypeReferenceExpression (typeof (uint)), sw), "#24");
sb.Length = 0;
Assert.AreEqual (typeof (ulong).FullName, Generate (new CodeTypeReferenceExpression (typeof (ulong)), sw), "#25");
sb.Length = 0;
Assert.AreEqual (typeof (float).FullName, Generate (new CodeTypeReferenceExpression (typeof (float)), sw), "#26");
sb.Length = 0;
#endif
sw.Close ();
}
}
@@ -253,17 +234,9 @@ namespace MonoTests.Microsoft.CSharp
sb.Length = 0;
Assert.AreEqual ("'\\''", Generate (new CodePrimitiveExpression ('\''), sw), "#39");
sb.Length = 0;
#if NET_2_0
Assert.AreEqual ("'\\u2028'", Generate (new CodePrimitiveExpression ('\u2028'), sw), "#40");
#else
Assert.AreEqual ("'\\u8232'", Generate (new CodePrimitiveExpression ('\u2028'), sw), "#40");
#endif
sb.Length = 0;
#if NET_2_0
Assert.AreEqual ("'\\u2029'", Generate (new CodePrimitiveExpression ('\u2029'), sw), "#41");
#else
Assert.AreEqual ("'\\u8233'", Generate (new CodePrimitiveExpression ('\u2029'), sw), "#41");
#endif
sb.Length = 0;
Assert.AreEqual ("'\u2030'", Generate (new CodePrimitiveExpression ('\u2030'), sw), "#42");
sw.Close ();
@@ -271,9 +244,6 @@ namespace MonoTests.Microsoft.CSharp
}
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentException))]
#endif
public void PrimitiveExpressionTest_SByte ()
{
StringBuilder sb = new StringBuilder ();
@@ -285,9 +255,6 @@ namespace MonoTests.Microsoft.CSharp
}
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentException))]
#endif
public void PrimitiveExpressionTest_UInt16 ()
{
StringBuilder sb = new StringBuilder ();
@@ -299,9 +266,6 @@ namespace MonoTests.Microsoft.CSharp
}
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentException))]
#endif
public void PrimitiveExpressionTest_UInt32 ()
{
StringBuilder sb = new StringBuilder ();
@@ -313,9 +277,6 @@ namespace MonoTests.Microsoft.CSharp
}
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentException))]
#endif
public void PrimitiveExpressionTest_UInt64 ()
{
StringBuilder sb = new StringBuilder ();
@@ -506,7 +467,6 @@ namespace MonoTests.Microsoft.CSharp
}
}
#if NET_2_0
[Test]
public void DefaultValueExpressionTest ()
{
@@ -518,7 +478,6 @@ namespace MonoTests.Microsoft.CSharp
sw.Close ();
}
}
#endif
[Test]
public void DelegateInvokeTest ()

View File

@@ -169,7 +169,6 @@ namespace MonoTests.Microsoft.CSharp
"}}{0}", NewLine), Generate (options), "#B2");
}
#if NET_2_0
[Test]
public void Type_TypeParameters ()
{
@@ -531,6 +530,5 @@ namespace MonoTests.Microsoft.CSharp
" }}{0}" +
"}}{0}", NewLine), Generate ());
}
#endif
}
}

View File

@@ -202,11 +202,7 @@ namespace MonoTests.Microsoft.CSharp
" ;;{0}" +
" DoB();{0}" +
" ;{0}" +
#if NET_2_0
"A{0}" +
#else
" A{0}" +
#endif
" DoC();{0}" +
"}}{0}", NewLine), Generate (), "#3");
@@ -217,20 +213,12 @@ namespace MonoTests.Microsoft.CSharp
" ;;{0}" +
" DoB();{0}" +
" ;{0}" +
#if NET_2_0
"A{0}" +
#else
" A{0}" +
#endif
" DoC();{0}" +
"}}{0}" +
"else {{{0}" +
" DoD();{0}" +
#if NET_2_0
"B{0}" +
#else
" B{0}" +
#endif
" ;;{0}" +
" DoE();{0}" +
" ;{0}" +
@@ -245,19 +233,11 @@ namespace MonoTests.Microsoft.CSharp
" ;;{0}" +
" DoB();{0}" +
" ;{0}" +
#if NET_2_0
"A{0}" +
#else
" A{0}" +
#endif
" DoC();{0}" +
"}} else {{{0}" +
" DoD();{0}" +
#if NET_2_0
"B{0}" +
#else
" B{0}" +
#endif
" ;;{0}" +
" DoE();{0}" +
" ;{0}" +
@@ -273,11 +253,7 @@ namespace MonoTests.Microsoft.CSharp
"}}{0}" +
"else {{{0}" +
" DoD();{0}" +
#if NET_2_0
"B{0}" +
#else
" B{0}" +
#endif
" ;;{0}" +
" DoE();{0}" +
" ;{0}" +
@@ -292,11 +268,7 @@ namespace MonoTests.Microsoft.CSharp
" ;;{0}" +
" DoB();{0}" +
" ;{0}" +
#if NET_2_0
"A{0}" +
#else
" A{0}" +
#endif
" DoC();{0}" +
"}}{0}", NewLine), Generate (), "#7");
}
@@ -380,17 +352,9 @@ namespace MonoTests.Microsoft.CSharp
" ;;{0}" +
" DoB();{0}" +
"test:{0}" +
#if NET_2_0
"C{0}" +
#else
" C{0}" +
#endif
" ;{0}" +
#if NET_2_0
"A{0}" +
#else
" A{0}" +
#endif
" DoC();{0}" +
"}}{0}", NewLine), Generate (), "#5");
}
@@ -411,11 +375,7 @@ namespace MonoTests.Microsoft.CSharp
cls.Statement = new CodeSnippetStatement ("A");
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
"class:{0}" +
#if NET_2_0
"A{0}",
#else
" A{0}",
#endif
NewLine), Generate (), "#3");
}
@@ -538,13 +498,8 @@ namespace MonoTests.Microsoft.CSharp
"catch (System.ApplicationException ) {{{0}" +
"}}{0}" +
"finally {{{0}" +
#if NET_2_0
"A{0}" +
"B{0}" +
#else
" A{0}" +
" B{0}" +
#endif
"}}{0}", NewLine), Generate (), "#1");
options.ElseOnClosing = true;
@@ -555,13 +510,8 @@ namespace MonoTests.Microsoft.CSharp
"}} catch (System.ArgumentException ex1) {{{0}" +
"}} catch (System.ApplicationException ) {{{0}" +
"}} finally {{{0}" +
#if NET_2_0
"A{0}" +
"B{0}" +
#else
" A{0}" +
" B{0}" +
#endif
"}}{0}", NewLine), Generate (), "#2");
statement = new CodeTryCatchFinallyStatement ();

View File

@@ -1 +1 @@
3fcc1d6d3b7c329eaaf86b7566cb5d50a7b77b74
42a42146a3e47507d1320ecd1a3e4d159db4df51

View File

@@ -9,9 +9,7 @@
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
#if NET_2_0
using System.Collections.Generic;
#endif
using NUnit.Framework;
@@ -30,7 +28,6 @@ namespace MonoTests.Microsoft.CSharp
gen = new CSharpCodeProvider ().CreateGenerator ();
}
#if NET_2_0
// This test fails on 2.0 profile, because our CodeTypeReference does not
// parse basetype from right to left.
[Test]
@@ -40,7 +37,6 @@ namespace MonoTests.Microsoft.CSharp
Assert.AreEqual ("A[,,][,]", gen.GetTypeOutput (new CodeTypeReference ("A[,,][,]")), "#5");
Assert.AreEqual ("A<B, D>[,]", gen.GetTypeOutput (new CodeTypeReference ("A[B,,D][,]")), "#6");
}
#endif
[Test]
public void GetTypeOutput ()
@@ -49,19 +45,8 @@ namespace MonoTests.Microsoft.CSharp
Assert.AreEqual ("A[]", gen.GetTypeOutput (new CodeTypeReference ("A[]")), "#2");
Assert.AreEqual ("int[]", gen.GetTypeOutput (new CodeTypeReference (typeof (int).FullName, 1)), "#3");
Assert.AreEqual ("int[,]", gen.GetTypeOutput (new CodeTypeReference (typeof (int).FullName, 2)), "#4");
#if NET_2_0
Assert.AreEqual ("System.Nullable<int>", gen.GetTypeOutput (new CodeTypeReference (typeof (int?))), "#7");
Assert.AreEqual ("System.Collections.Generic.Dictionary<int, string>", gen.GetTypeOutput (new CodeTypeReference (typeof (Dictionary<int, string>))), "#8");
#else
Assert.AreEqual ("A[,,][,]", gen.GetTypeOutput (new CodeTypeReference ("A[,,][,]")), "#5");
Assert.AreEqual ("A[B,,D][,]", gen.GetTypeOutput (new CodeTypeReference ("A[B,,D][,]")), "#6");
Assert.AreEqual ("System.Nullable`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]",
gen.GetTypeOutput (new CodeTypeReference ("System.Nullable`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]")),
"#9");
Assert.AreEqual ("System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]",
gen.GetTypeOutput (new CodeTypeReference ("System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]")),
"#10");
#endif
}
[Test]
@@ -82,7 +67,6 @@ namespace MonoTests.Microsoft.CSharp
Assert.AreEqual ("object", gen.GetTypeOutput (new CodeTypeReference ("systeM.oBject")), "#14");
Assert.AreEqual ("void", gen.GetTypeOutput (new CodeTypeReference (typeof(void))), "#15");
Assert.AreEqual ("void", gen.GetTypeOutput (new CodeTypeReference ("systeM.vOid")), "#16");
#if NET_2_0
Assert.AreEqual ("byte", gen.GetTypeOutput (new CodeTypeReference (typeof(byte))), "#17");
Assert.AreEqual ("byte", gen.GetTypeOutput (new CodeTypeReference ("systeM.bYte")), "#18");
Assert.AreEqual ("sbyte", gen.GetTypeOutput (new CodeTypeReference (typeof(sbyte))), "#19");
@@ -99,24 +83,6 @@ namespace MonoTests.Microsoft.CSharp
Assert.AreEqual ("ulong", gen.GetTypeOutput (new CodeTypeReference ("systeM.uinT64")), "#30");
Assert.AreEqual ("ushort", gen.GetTypeOutput (new CodeTypeReference (typeof (ushort))), "#31");
Assert.AreEqual ("ushort", gen.GetTypeOutput (new CodeTypeReference ("systeM.uinT16")), "#32");
#else
Assert.AreEqual (typeof (byte).FullName, gen.GetTypeOutput (new CodeTypeReference (typeof (byte))), "#17");
Assert.AreEqual ("systeM.bYte", gen.GetTypeOutput (new CodeTypeReference ("systeM.bYte")), "#18");
Assert.AreEqual (typeof (sbyte).FullName, gen.GetTypeOutput (new CodeTypeReference (typeof (sbyte))), "#19");
Assert.AreEqual ("systeM.sBYte", gen.GetTypeOutput (new CodeTypeReference ("systeM.sBYte")), "#20");
Assert.AreEqual (typeof (decimal).FullName, gen.GetTypeOutput (new CodeTypeReference (typeof (decimal))), "#21");
Assert.AreEqual ("systeM.dEcimal", gen.GetTypeOutput (new CodeTypeReference ("systeM.dEcimal")), "#22");
Assert.AreEqual (typeof (double).FullName, gen.GetTypeOutput (new CodeTypeReference (typeof (double))), "#23");
Assert.AreEqual ("systeM.dOuble", gen.GetTypeOutput (new CodeTypeReference ("systeM.dOuble")), "#24");
Assert.AreEqual (typeof (float).FullName, gen.GetTypeOutput (new CodeTypeReference (typeof (float))), "#25");
Assert.AreEqual ("systeM.SiNgle", gen.GetTypeOutput (new CodeTypeReference ("systeM.SiNgle")), "#26");
Assert.AreEqual (typeof (uint).FullName, gen.GetTypeOutput (new CodeTypeReference (typeof (uint))), "#27");
Assert.AreEqual ("systeM.UinT32", gen.GetTypeOutput (new CodeTypeReference ("systeM.UinT32")), "#28");
Assert.AreEqual (typeof (ulong).FullName, gen.GetTypeOutput (new CodeTypeReference (typeof (ulong))), "#29");
Assert.AreEqual ("systeM.uinT64", gen.GetTypeOutput (new CodeTypeReference ("systeM.uinT64")), "#30");
Assert.AreEqual (typeof (ushort).FullName, gen.GetTypeOutput (new CodeTypeReference (typeof (ushort))), "#31");
Assert.AreEqual ("systeM.uinT16", gen.GetTypeOutput (new CodeTypeReference ("systeM.uinT16")), "#32");
#endif
}
}
}

View File

@@ -86,7 +86,6 @@ namespace MonoTests.Microsoft.VisualBasic
sb.Length = 0;
Assert.AreEqual (typeof (void).FullName, Generate (new CodeTypeReferenceExpression (""), sw), "#14");
sb.Length = 0;
#if NET_2_0
Assert.AreEqual ("SByte", Generate (new CodeTypeReferenceExpression (typeof (sbyte)), sw), "#15");
sb.Length = 0;
Assert.AreEqual ("UShort", Generate (new CodeTypeReferenceExpression (typeof (ushort)), sw), "#16");
@@ -95,16 +94,6 @@ namespace MonoTests.Microsoft.VisualBasic
sb.Length = 0;
Assert.AreEqual ("ULong", Generate (new CodeTypeReferenceExpression (typeof (ulong)), sw), "#18");
sb.Length = 0;
#else
Assert.AreEqual (typeof (sbyte).FullName, Generate (new CodeTypeReferenceExpression (typeof (sbyte)), sw), "#19");
sb.Length = 0;
Assert.AreEqual (typeof(ushort).FullName, Generate (new CodeTypeReferenceExpression (typeof (ushort)), sw), "#20");
sb.Length = 0;
Assert.AreEqual (typeof(uint).FullName, Generate (new CodeTypeReferenceExpression (typeof (uint)), sw), "#21");
sb.Length = 0;
Assert.AreEqual (typeof(ulong).FullName, Generate (new CodeTypeReferenceExpression (typeof (ulong)), sw), "#22");
sb.Length = 0;
#endif
sw.Close ();
}
}
@@ -153,11 +142,7 @@ namespace MonoTests.Microsoft.VisualBasic
[Test]
public void PrimitiveExpressionTest_Char ()
{
#if NET_2_0
string vbNs = "Global.Microsoft.VisualBasic";
#else
string vbNs = "Microsoft.VisualBasic";
#endif
StringBuilder sb = new StringBuilder ();
using (StringWriter sw = new StringWriter (sb)) {
@@ -251,9 +236,6 @@ namespace MonoTests.Microsoft.VisualBasic
}
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentException))]
#endif
public void PrimitiveExpressionTest_SByte ()
{
StringBuilder sb = new StringBuilder ();
@@ -265,9 +247,6 @@ namespace MonoTests.Microsoft.VisualBasic
}
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentException))]
#endif
public void PrimitiveExpressionTest_UInt16 ()
{
StringBuilder sb = new StringBuilder ();
@@ -279,9 +258,6 @@ namespace MonoTests.Microsoft.VisualBasic
}
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentException))]
#endif
public void PrimitiveExpressionTest_UInt32 ()
{
StringBuilder sb = new StringBuilder ();
@@ -293,9 +269,6 @@ namespace MonoTests.Microsoft.VisualBasic
}
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentException))]
#endif
public void PrimitiveExpressionTest_UInt64 ()
{
StringBuilder sb = new StringBuilder ();
@@ -315,28 +288,16 @@ namespace MonoTests.Microsoft.VisualBasic
using (StringWriter sw = new StringWriter (sb)) {
cpde = new CodeParameterDeclarationExpression ();
#if NET_2_0
Assert.AreEqual ("ByVal __exception As System.Void", Generate (cpde, sw), "#1");
#else
Assert.AreEqual ("ByVal As System.Void", Generate (cpde, sw), "#1");
#endif
sb.Length = 0;
cpde = new CodeParameterDeclarationExpression ((string) null,
(string) null);
#if NET_2_0
Assert.AreEqual ("ByVal __exception As System.Void", Generate (cpde, sw), "#2");
#else
Assert.AreEqual ("ByVal As System.Void", Generate (cpde, sw), "#2");
#endif
sb.Length = 0;
cpde = new CodeParameterDeclarationExpression ("A", (string) null);
#if NET_2_0
Assert.AreEqual ("ByVal __exception As A", Generate (cpde, sw), "#3");
#else
Assert.AreEqual ("ByVal As A", Generate (cpde, sw), "#3");
#endif
sb.Length = 0;
cpde = new CodeParameterDeclarationExpression ((string) null, "B");
@@ -507,31 +468,19 @@ namespace MonoTests.Microsoft.VisualBasic
sb = new StringBuilder ();
using (StringWriter sw = new StringWriter (sb)) {
code = Generate (new CodeDelegateInvokeExpression (null, new CodePrimitiveExpression ("abc")), sw);
#if NET_2_0
Assert.AreEqual ("(\"abc\")", code, "#01");
#else
Assert.AreEqual ("RaiseEvent (\"abc\")", code, "#01");
#endif
}
sb = new StringBuilder ();
using (StringWriter sw = new StringWriter (sb)) {
code = Generate (new CodeDelegateInvokeExpression (new CodeThisReferenceExpression (), new CodePrimitiveExpression ("abc")), sw);
#if NET_2_0
Assert.AreEqual ("Me(\"abc\")", code, "#02");
#else
Assert.AreEqual ("RaiseEvent Me(\"abc\")", code, "#02");
#endif
}
sb = new StringBuilder ();
using (StringWriter sw = new StringWriter (sb)) {
code = Generate (new CodeDelegateInvokeExpression (new CodePrimitiveExpression ("primitive"), new CodePrimitiveExpression ("abc")), sw);
#if NET_2_0
Assert.AreEqual ("\"primitive\"(\"abc\")", code, "#03");
#else
Assert.AreEqual ("RaiseEvent \"primitive\"(\"abc\")", code, "#03");
#endif
}
sb = new StringBuilder ();

View File

@@ -161,7 +161,6 @@ namespace MonoTests.Microsoft.VisualBasic
"End Namespace{0}", NewLine), Generate (options), "#B2");
}
#if NET_2_0
[Test]
public void Type_TypeParameters ()
{
@@ -478,6 +477,5 @@ namespace MonoTests.Microsoft.VisualBasic
" End Class{0}" +
"End Namespace{0}", NewLine), Generate ());
}
#endif
}
}

View File

@@ -243,11 +243,7 @@ namespace MonoTests.Microsoft.VisualBasic
" ;{0}" +
" DoB(){0}" +
" {0}" +
#if NET_2_0
"A{0}" +
#else
" A{0}" +
#endif
" DoC(){0}" +
"End If{0}", NewLine), Generate (), "#3");
@@ -258,19 +254,11 @@ namespace MonoTests.Microsoft.VisualBasic
" ;{0}" +
" DoB(){0}" +
" {0}" +
#if NET_2_0
"A{0}" +
#else
" A{0}" +
#endif
" DoC(){0}" +
"Else{0}" +
" DoD(){0}" +
#if NET_2_0
"B{0}" +
#else
" B{0}" +
#endif
" ;{0}" +
" DoE(){0}" +
" {0}" +
@@ -285,19 +273,11 @@ namespace MonoTests.Microsoft.VisualBasic
" ;{0}" +
" DoB(){0}" +
" {0}" +
#if NET_2_0
"A{0}" +
#else
" A{0}" +
#endif
" DoC(){0}" +
"Else{0}" +
" DoD(){0}" +
#if NET_2_0
"B{0}" +
#else
" B{0}" +
#endif
" ;{0}" +
" DoE(){0}" +
" {0}" +
@@ -312,11 +292,7 @@ namespace MonoTests.Microsoft.VisualBasic
"If true == false Then{0}" +
"Else{0}" +
" DoD(){0}" +
#if NET_2_0
"B{0}" +
#else
" B{0}" +
#endif
" ;{0}" +
" DoE(){0}" +
" {0}" +
@@ -331,11 +307,7 @@ namespace MonoTests.Microsoft.VisualBasic
" ;{0}" +
" DoB(){0}" +
" {0}" +
#if NET_2_0
"A{0}" +
#else
" A{0}" +
#endif
" DoC(){0}" +
"End If{0}", NewLine), Generate (), "#7");
}
@@ -422,17 +394,9 @@ namespace MonoTests.Microsoft.VisualBasic
" ;{0}" +
" DoB(){0}" +
"test:{0}" +
#if NET_2_0
"C{0}" +
#else
" C{0}" +
#endif
" {0}" +
#if NET_2_0
"A{0}" +
#else
" A{0}" +
#endif
" DoC(){0}" +
" testInt = (testInt + 1){0}" +
"Loop{0}", NewLine), Generate (), "#5");
@@ -454,11 +418,7 @@ namespace MonoTests.Microsoft.VisualBasic
cls.Statement = new CodeSnippetStatement ("A");
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
"class:{0}" +
#if NET_2_0
"A{0}",
#else
" A{0}",
#endif
NewLine), Generate (), "#3");
}
@@ -575,19 +535,10 @@ namespace MonoTests.Microsoft.VisualBasic
"Try {0}" +
" goto exit{0}" +
"Catch ex1 As System.ArgumentException{0}" +
#if NET_2_0
"Catch __exception As System.ApplicationException{0}" +
#else
"Catch As System.ApplicationException{0}" +
#endif
"Finally{0}" +
#if NET_2_0
"A{0}" +
"B{0}" +
#else
" A{0}" +
" B{0}" +
#endif
"End Try{0}", NewLine), Generate (), "#1");
options.ElseOnClosing = true;
@@ -595,19 +546,10 @@ namespace MonoTests.Microsoft.VisualBasic
"Try {0}" +
" goto exit{0}" +
"Catch ex1 As System.ArgumentException{0}" +
#if NET_2_0
"Catch __exception As System.ApplicationException{0}" +
#else
"Catch As System.ApplicationException{0}" +
#endif
"Finally{0}" +
#if NET_2_0
"A{0}" +
"B{0}" +
#else
" A{0}" +
" B{0}" +
#endif
"End Try{0}", NewLine), Generate (), "#2");
statement = new CodeTryCatchFinallyStatement ();
@@ -630,11 +572,7 @@ namespace MonoTests.Microsoft.VisualBasic
statement = cvds;
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
#if NET_2_0
"Dim __exception As System.Void{0}",
#else
"Dim As System.Void{0}",
#endif
NewLine), Generate (), "#1");
cvds.Name = "class";
@@ -655,11 +593,7 @@ namespace MonoTests.Microsoft.VisualBasic
cvds.Name = null;
Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
#if NET_2_0
"Dim __exception As Integer = 25{0}",
#else
"Dim As Integer = 25{0}",
#endif
NewLine), Generate (), "#6");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
207bb9f47864178e6c88bf4d5a4dd313bed99f8e

View File

@@ -66,7 +66,6 @@ namespace MonoCasTests.Microsoft.VisualBasic {
catch (NotImplementedException) {
// mono
}
#if NET_2_0
CodeTypeMember ctm = new CodeTypeMember ();
StringWriter sw = new StringWriter ();
CodeGeneratorOptions cgo = new CodeGeneratorOptions ();
@@ -76,7 +75,6 @@ namespace MonoCasTests.Microsoft.VisualBasic {
catch (NotImplementedException) {
// mono
}
#endif
}
// LinkDemand

View File

@@ -109,13 +109,11 @@ namespace MonoTests.Microsoft.VisualBasic
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.StaticConstructors), "#20");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.TryCatchStatements), "#21");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.Win32Resources), "#22");
#if NET_2_0
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.DeclareIndexerProperties), "#23");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.GenericTypeDeclaration), "#24");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.GenericTypeReference), "#25");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.PartialTypes), "#26");
Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.Resources), "#27");
#endif
}
[Test]
@@ -211,9 +209,7 @@ namespace MonoTests.Microsoft.VisualBasic
options.GenerateExecutable = false;
options.GenerateInMemory = true;
options.TempFiles = new TempFileCollection (_tempDir);
#if NET_2_0
options.EmbeddedResources.Add (sourceFile);
#endif
ICodeCompiler compiler = _codeProvider.CreateCompiler ();
CompilerResults results = compiler.CompileAssemblyFromFile (options,
@@ -234,14 +230,12 @@ namespace MonoTests.Microsoft.VisualBasic
Assert.AreEqual (1, tempFiles.Length, "#5");
Assert.AreEqual (sourceFile, tempFiles[0], "#6");
#if NET_2_0
string[] resources = compiledAssembly.GetManifestResourceNames();
Assert.IsNotNull (resources, "#7");
Assert.AreEqual (1, resources.Length, "#8");
Assert.AreEqual ("file.vb", resources[0], "#9");
Assert.IsNull (compiledAssembly.GetFile ("file.vb"), "#10");
Assert.IsNotNull (compiledAssembly.GetManifestResourceStream ("file.vb"), "#11");
#endif
}
[Test]
@@ -272,10 +266,8 @@ namespace MonoTests.Microsoft.VisualBasic
options.GenerateInMemory = true;
options.OutputAssembly = string.Empty;
options.TempFiles = new TempFileCollection (_tempDir);
#if NET_2_0
options.EmbeddedResources.Add (sourceFile1);
options.LinkedResources.Add (sourceFile2);
#endif
ICodeCompiler compiler = _codeProvider.CreateCompiler ();
CompilerResults results = compiler.CompileAssemblyFromFileBatch (options,
@@ -303,7 +295,6 @@ namespace MonoTests.Microsoft.VisualBasic
Assert.IsTrue (File.Exists (sourceFile1), "#C2");
Assert.IsTrue (File.Exists (sourceFile2), "#C3");
#if NET_2_0
string[] resources = compiledAssembly.GetManifestResourceNames();
Assert.IsNotNull (resources, "#D1");
Assert.AreEqual (2, resources.Length, "#D2");
@@ -334,7 +325,6 @@ namespace MonoTests.Microsoft.VisualBasic
Assert.AreEqual ("file2.vb", info.FileName, "#F6");
Assert.IsNull (info.ReferencedAssembly, "#F7");
Assert.AreEqual ((ResourceLocation) 0, info.ResourceLocation, "#F8");
#endif
}
[Test]
@@ -364,10 +354,8 @@ namespace MonoTests.Microsoft.VisualBasic
options.GenerateExecutable = false;
options.GenerateInMemory = true;
options.TempFiles = new TempFileCollection (_tempDir);
#if NET_2_0
options.EmbeddedResources.Add (sourceFile1);
options.LinkedResources.Add (sourceFile2);
#endif
ICodeCompiler compiler = _codeProvider.CreateCompiler ();
CompilerResults results = compiler.CompileAssemblyFromFileBatch (options,
@@ -395,7 +383,6 @@ namespace MonoTests.Microsoft.VisualBasic
Assert.IsTrue (File.Exists (sourceFile1), "#C2");
Assert.IsTrue (File.Exists (sourceFile2), "#C3");
#if NET_2_0
string[] resources = compiledAssembly.GetManifestResourceNames();
Assert.IsNotNull (resources, "#D1");
Assert.AreEqual (2, resources.Length, "#D2");
@@ -426,7 +413,6 @@ namespace MonoTests.Microsoft.VisualBasic
Assert.AreEqual ("file2.vb", info.FileName, "#F6");
Assert.IsNull (info.ReferencedAssembly, "#F7");
Assert.AreEqual ((ResourceLocation) 0, info.ResourceLocation, "#F8");
#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;
@@ -114,4 +113,3 @@ namespace MonoCasTests.Microsoft.Win32 {
}
}
#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;
@@ -161,4 +160,3 @@ namespace MonoTests.Microsoft.Win32 {
}
}
#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;
@@ -98,4 +97,3 @@ namespace MonoCasTests.Microsoft.Win32 {
}
}
#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;
@@ -60,4 +59,3 @@ namespace MonoTests.Microsoft.Win32 {
}
}
#endif

View File

@@ -82,7 +82,6 @@ namespace MonoCasTests.Microsoft.Win32 {
// mono
}
}
#if NET_2_0
[Test]
[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
public void DisplaySettingsChanging_Deny_Unrestricted ()
@@ -95,7 +94,6 @@ namespace MonoCasTests.Microsoft.Win32 {
// mono
}
}
#endif
[Test]
[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
public void EventsThreadShutdown_Deny_Unrestricted ()
@@ -198,7 +196,6 @@ namespace MonoCasTests.Microsoft.Win32 {
// mono
}
}
#if NET_2_0
private void SessionSwitchCallback (object o, SessionSwitchEventArgs args)
{
}
@@ -215,7 +212,6 @@ namespace MonoCasTests.Microsoft.Win32 {
// mono
}
}
#endif
[Test]
[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
public void TimeChanged_Deny_Unrestricted ()

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 ();

Some files were not shown because too many files have changed in this diff Show More