提交 4a6dec85 编写于 作者: S Sebastien Pouliot

[corlib][tests] Disable tests that requires Windows (dllimport) on mobile profile

This enables building the tests w/bitcode enabled on AppleTV (and they
were already excluded from the results anyway).

Part of the fix for
https://bugzilla.xamarin.com/show_bug.cgi?id=36569
上级 0c1916e5
......@@ -52,7 +52,12 @@ namespace MonoTests.System.Reflection
[TestFixture]
public class MethodInfoTest
{
#if MONOTOUCH
// 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
[DllImport ("libfoo", EntryPoint="foo", CharSet=CharSet.Unicode, ExactSpelling=false, PreserveSig=true, SetLastError=true, BestFitMapping=true, ThrowOnUnmappableChar=true)]
#endif
public static extern void dllImportMethod ();
[MethodImplAttribute(MethodImplOptions.PreserveSig)]
public void preserveSigMethod ()
......@@ -108,8 +113,13 @@ namespace MonoTests.System.Reflection
DllImportAttribute attr = (DllImportAttribute)((t.GetMethod ("dllImportMethod").GetCustomAttributes (typeof (DllImportAttribute), true)) [0]);
Assert.AreEqual (CallingConvention.Winapi, attr.CallingConvention, "#1");
#if MONOTOUCH
Assert.AreEqual ("readlink", attr.EntryPoint, "#2");
Assert.AreEqual ("libc", attr.Value, "#3");
#else
Assert.AreEqual ("foo", attr.EntryPoint, "#2");
Assert.AreEqual ("libfoo", attr.Value, "#3");
#endif
Assert.AreEqual (CharSet.Unicode, attr.CharSet, "#4");
Assert.AreEqual (false, attr.ExactSpelling, "#5");
Assert.AreEqual (true, attr.PreserveSig, "#6");
......
......@@ -805,6 +805,7 @@ namespace MonoTests.System.Runtime.InteropServices
}
}
#if !MOBILE
[DllImport ("kernel32.dll", SetLastError = true)]
[PreserveSig]
static extern uint GetModuleFileName (
......@@ -816,6 +817,7 @@ namespace MonoTests.System.Runtime.InteropServices
[MarshalAs (UnmanagedType.U4)]
int nSize
);
#endif
}
#if !NET_2_1
[ComImport()]
......
......@@ -72,6 +72,7 @@ namespace MonoTests.System.Security.Cryptography.X509Certificates {
File.Delete("temp.b64");
}
#if !MOBILE
public IntPtr GetHandleEx (byte[] certificate)
{
CertificateContext cc = new CertificateContext ();
......@@ -151,6 +152,7 @@ namespace MonoTests.System.Security.Cryptography.X509Certificates {
Assert.AreEqual (serial, x509.GetSerialNumber (), "GetSerialNumber");
Assert.AreEqual ("02720006E8", x509.GetSerialNumberString (), "GetSerialNumberString");
}
#endif
[Test]
[ExpectedException (typeof (ArgumentException))]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册