You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@@ -5,7 +5,7 @@
|
||||
// (C) 2004 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
#if !MONOTOUCH
|
||||
#if !MONOTOUCH && !MOBILE_STATIC
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
@@ -37,7 +37,7 @@ using System.Configuration.Assemblies;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
#if !MONOTOUCH
|
||||
#if !MONOTOUCH && !MOBILE_STATIC
|
||||
using System.Reflection.Emit;
|
||||
#endif
|
||||
using System.Threading;
|
||||
@@ -182,7 +182,10 @@ namespace MonoTests.System.Reflection
|
||||
// note: only available in default appdomain
|
||||
// http://weblogs.asp.net/asanto/archive/2003/09/08/26710.aspx
|
||||
// Not sure we should emulate this behavior.
|
||||
#if !MONODROID
|
||||
#if __WATCHOS__
|
||||
Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
|
||||
Assert.IsTrue (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
|
||||
#elif !MONODROID
|
||||
string fname = AppDomain.CurrentDomain.FriendlyName;
|
||||
if (fname.EndsWith (".dll")) { // nunit-console
|
||||
Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
|
||||
@@ -197,7 +200,7 @@ namespace MonoTests.System.Reflection
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !MONOTOUCH // Reflection.Emit is not supported.
|
||||
#if !MONOTOUCH && !MOBILE_STATIC // Reflection.Emit is not supported.
|
||||
[Test]
|
||||
[Category("AndroidNotWorking")] // Missing Mono.CompilerServices.SymbolWriter
|
||||
public void GetModules_MissingFile ()
|
||||
@@ -249,7 +252,7 @@ namespace MonoTests.System.Reflection
|
||||
public void Corlib_test ()
|
||||
{
|
||||
Assembly corlib_test = Assembly.GetExecutingAssembly ();
|
||||
#if MONODROID
|
||||
#if MONODROID || MOBILE_STATIC || __WATCHOS__
|
||||
Assert.IsNull (corlib_test.EntryPoint, "EntryPoint");
|
||||
Assert.IsNull (corlib_test.Evidence, "Evidence");
|
||||
#elif MOBILE
|
||||
@@ -457,7 +460,18 @@ namespace MonoTests.System.Reflection
|
||||
[Test]
|
||||
public void LoadWithPartialName ()
|
||||
{
|
||||
string [] names = { "corlib_test_net_1_1", "corlib_test_net_2_0", "corlib_test_net_4_0", "corlib_test_net_4_5", "corlib_test_net_4_x", "corlib_plattest", "mscorlibtests", "BclTests" };
|
||||
// FIXME?
|
||||
// So the problem here is that if we load an assembly
|
||||
// in a fully aot mode and then cannot load the
|
||||
// dylib, we will assert. This test is incompatible
|
||||
// with the semantics of aot'ed assembly loading, as
|
||||
// aot may assert when loading. This assumes that it's
|
||||
// safe to greedly load everything.
|
||||
#if MOBILE_STATIC
|
||||
string [] names = { "mobile_static_corlib_test" };
|
||||
#else
|
||||
string [] names = { "corlib_test_net_1_1", "corlib_test_net_2_0", "corlib_test_net_4_0", "corlib_test_net_4_5", "net_4_x_corlib_test", "corlib_plattest", "mscorlibtests", "BclTests" };
|
||||
#endif
|
||||
|
||||
foreach (string s in names)
|
||||
if (Assembly.LoadWithPartialName (s) != null)
|
||||
@@ -502,7 +516,7 @@ namespace MonoTests.System.Reflection
|
||||
}
|
||||
}
|
||||
|
||||
#if !MONOTOUCH // Reflection.Emit is not supported.
|
||||
#if !MONOTOUCH && !MOBILE_STATIC // Reflection.Emit is not supported.
|
||||
[Test]
|
||||
public void Location_Empty() {
|
||||
string assemblyFileName = Path.Combine (
|
||||
@@ -1175,7 +1189,7 @@ namespace MonoTests.System.Reflection
|
||||
|
||||
Assert.AreEqual ("MonoModule", module.GetType ().Name, "#2");
|
||||
|
||||
#if !MONOTOUCH
|
||||
#if !MONOTOUCH && !MOBILE_STATIC
|
||||
Assert.AreEqual ("mscorlib.dll", module.Name, "#3");
|
||||
#endif
|
||||
Assert.IsFalse (module.IsResource (), "#4");
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -31,7 +31,7 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Reflection;
|
||||
#if !MONOTOUCH
|
||||
#if !MONOTOUCH && !MOBILE_STATIC
|
||||
using System.Reflection.Emit;
|
||||
#endif
|
||||
using System.Runtime.InteropServices;
|
||||
|
@@ -33,7 +33,7 @@ using NUnit.Framework;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Reflection;
|
||||
#if !MONOTOUCH
|
||||
#if !MONOTOUCH && !MOBILE_STATIC
|
||||
using System.Reflection.Emit;
|
||||
#endif
|
||||
using System.Runtime.InteropServices;
|
||||
@@ -54,7 +54,7 @@ namespace MonoTests.System.Reflection
|
||||
[TestFixture]
|
||||
public class MethodInfoTest
|
||||
{
|
||||
#if MONOTOUCH
|
||||
#if MONOTOUCH || MOBILE_STATIC
|
||||
// use an existing symbol - so we can build without dlsym. It does not matter that the signature does not match for the test
|
||||
[DllImport ("libc", EntryPoint="readlink", CharSet=CharSet.Unicode, ExactSpelling=false, PreserveSig=true, SetLastError=true, BestFitMapping=true, ThrowOnUnmappableChar=true)]
|
||||
#else
|
||||
@@ -115,7 +115,7 @@ namespace MonoTests.System.Reflection
|
||||
DllImportAttribute attr = (DllImportAttribute)((t.GetMethod ("dllImportMethod").GetCustomAttributes (typeof (DllImportAttribute), true)) [0]);
|
||||
|
||||
Assert.AreEqual (CallingConvention.Winapi, attr.CallingConvention, "#1");
|
||||
#if MONOTOUCH
|
||||
#if MONOTOUCH || MOBILE_STATIC
|
||||
Assert.AreEqual ("readlink", attr.EntryPoint, "#2");
|
||||
Assert.AreEqual ("libc", attr.Value, "#3");
|
||||
#else
|
||||
@@ -308,6 +308,9 @@ namespace MonoTests.System.Reflection
|
||||
public override void f2 () { }
|
||||
}
|
||||
|
||||
class DerivedFromGenericBase : GenericBase<int, int> {
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetBaseDefinition_OpenConstructedBaseType () // 36305
|
||||
{
|
||||
@@ -394,7 +397,7 @@ namespace MonoTests.System.Reflection
|
||||
[Test]
|
||||
public void GetMethodBody ()
|
||||
{
|
||||
#if MONOTOUCH && !DEBUG
|
||||
#if (MONOTOUCH || MOBILE_STATIC) && !DEBUG
|
||||
Assert.Ignore ("Release app (on devices) are stripped of (managed) IL so this test would fail");
|
||||
#endif
|
||||
MethodBody mb = typeof (MethodInfoTest).GetMethod ("locals_method").GetMethodBody ();
|
||||
@@ -597,7 +600,7 @@ namespace MonoTests.System.Reflection
|
||||
} catch (InvalidOperationException ex) {
|
||||
}
|
||||
}
|
||||
#if !MONOTOUCH
|
||||
#if !MONOTOUCH && !MOBILE_STATIC
|
||||
public TFoo SimpleGenericMethod2<TFoo, TBar> () { return default (TFoo); }
|
||||
/*Test for the uggly broken behavior of SRE.*/
|
||||
[Test]
|
||||
@@ -824,7 +827,34 @@ namespace MonoTests.System.Reflection
|
||||
Assert.AreEqual ("System.Nullable`1[System.Int32] Bug12856()", m.ToString (), "#1");
|
||||
}
|
||||
|
||||
#if !MONOTOUCH
|
||||
[Test]
|
||||
public void GetReflectedType () // #12205
|
||||
{
|
||||
// public method declared in base type, queried from a derived type
|
||||
MethodInfo mi = typeof (TestInheritedMethodB).GetMethod ("TestMethod2");
|
||||
Assert.AreEqual (mi.ReflectedType, typeof (TestInheritedMethodB), "#1");
|
||||
|
||||
// public method declared in a generic class,
|
||||
// queried from a non-generic class derived
|
||||
// from an instantiation of the generic class.
|
||||
mi = typeof (DerivedFromGenericBase).GetMethod ("f2");
|
||||
Assert.AreEqual (mi.ReflectedType, typeof (DerivedFromGenericBase), "#2");
|
||||
|
||||
// public method declared in a generic class,
|
||||
// queried from the generic type defintion of
|
||||
// a generic derived class.
|
||||
mi = typeof (GenericMid<,>).GetMethod ("f2");
|
||||
Assert.AreEqual (mi.ReflectedType, typeof (GenericMid<,>), "#3");
|
||||
|
||||
// public method declared in a generic class,
|
||||
// queried from an instantiation of a generic
|
||||
// derived class.
|
||||
mi = typeof (GenericMid<int,int>).GetMethod ("f2");
|
||||
Assert.AreEqual (mi.ReflectedType, typeof (GenericMid<int,int>), "#4");
|
||||
|
||||
}
|
||||
|
||||
#if !MONOTOUCH && !MOBILE_STATIC
|
||||
class GenericClass<T>
|
||||
{
|
||||
public void Method ()
|
||||
|
@@ -10,7 +10,7 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Reflection;
|
||||
#if !MONOTOUCH
|
||||
#if !MONOTOUCH && !MOBILE_STATIC
|
||||
using System.Reflection.Emit;
|
||||
#endif
|
||||
using System.Runtime.Serialization;
|
||||
@@ -93,7 +93,7 @@ public class ModuleTest
|
||||
}
|
||||
|
||||
// Some of these tests overlap with the tests for ModuleBuilder
|
||||
#if !MONOTOUCH
|
||||
#if !MONOTOUCH && !MOBILE_STATIC
|
||||
[Test]
|
||||
[Category("NotDotNet")] // path length can cause suprious failures
|
||||
public void TestGlobalData () {
|
||||
@@ -328,7 +328,7 @@ public class ModuleTest
|
||||
Module m = typeof (ModuleTest).Module;
|
||||
m.GetObjectData (null, new StreamingContext (StreamingContextStates.All));
|
||||
}
|
||||
#if !MONOTOUCH
|
||||
#if !MONOTOUCH && !MOBILE_STATIC
|
||||
[Test]
|
||||
[Category ("AndroidNotWorking")] // Mono.CompilerServices.SymbolWriter not available for Xamarin.Android
|
||||
public void GetTypes ()
|
||||
|
@@ -7,7 +7,7 @@
|
||||
// Copyright 2011 Xamarin Inc (http://www.xamarin.com).
|
||||
//
|
||||
|
||||
#if !MONOTOUCH
|
||||
#if !MONOTOUCH && !MOBILE_STATIC
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
@@ -31,7 +31,7 @@ using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
#if !MONOTOUCH
|
||||
#if !MONOTOUCH && !MOBILE_STATIC
|
||||
using System.Reflection.Emit;
|
||||
#endif
|
||||
using System.IO;
|
||||
@@ -355,7 +355,7 @@ namespace MonoTests.System.Reflection
|
||||
get { return 99; }
|
||||
}
|
||||
}
|
||||
#if !MONOTOUCH
|
||||
#if !MONOTOUCH && !MOBILE_STATIC
|
||||
[Test]
|
||||
public void ConstantValue () {
|
||||
/*This test looks scary because we can't generate a default value with C# */
|
||||
|
@@ -28,7 +28,7 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Reflection;
|
||||
#if !MONOTOUCH
|
||||
#if !MONOTOUCH && !MOBILE_STATIC
|
||||
using System.Reflection.Emit;
|
||||
#endif
|
||||
|
||||
|
@@ -24,7 +24,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#if !MONOTOUCH
|
||||
#if !MONOTOUCH && !MOBILE_STATIC
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
Reference in New Issue
Block a user