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

@@ -82,7 +82,6 @@ namespace MonoCasTests.System.IO.IsolatedStorageTest {
}
}
#if NET_2_0
[Test]
[IsolatedStorageFilePermission (SecurityAction.Deny, UsageAllowed = IsolatedStorageContainment.ApplicationIsolationByMachine)]
[ExpectedException (typeof (SecurityException))]
@@ -176,7 +175,6 @@ namespace MonoCasTests.System.IO.IsolatedStorageTest {
{
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication ();
}
#endif
[Test]
[IsolatedStorageFilePermission (SecurityAction.Deny, UsageAllowed = IsolatedStorageContainment.AssemblyIsolationByUser)]
[ExpectedException (typeof (SecurityException))]
@@ -291,13 +289,8 @@ namespace MonoCasTests.System.IO.IsolatedStorageTest {
{
Assert.AreEqual (Int64.MaxValue, MaximumSize (SecurityZone.MyComputer), "MyComputer");
Assert.AreEqual (Int64.MaxValue, MaximumSize (SecurityZone.Intranet), "Intranet");
#if NET_2_0
Assert.AreEqual (512000, MaximumSize (SecurityZone.Internet), "Internet");
Assert.AreEqual (512000, MaximumSize (SecurityZone.Trusted), "Trusted");
#else
Assert.AreEqual (10240, MaximumSize (SecurityZone.Internet), "Internet");
Assert.AreEqual (10240, MaximumSize (SecurityZone.Trusted), "Trusted");
#endif
}
[Test]

View File

@@ -37,9 +37,7 @@ using System.Security;
using System.Security.Permissions;
using System.Threading;
#if NET_2_0
using Microsoft.Win32.SafeHandles;
#endif
namespace MonoCasTests.System.IO.IsolatedStorageTest {
@@ -229,7 +227,6 @@ namespace MonoCasTests.System.IO.IsolatedStorageTest {
IntPtr p = isfs.Handle;
// Note: The SecurityException for UnmanagedCode cannot be tested here because it's a LinkDemand
}
#if NET_2_0
[Test]
[IsolatedStorageFilePermission (SecurityAction.PermitOnly, Unrestricted = true)]
[ExpectedException (typeof (IsolatedStorageException))]
@@ -239,7 +236,6 @@ namespace MonoCasTests.System.IO.IsolatedStorageTest {
SafeFileHandle sfh = isfs.SafeFileHandle;
// Note: The SecurityException for UnmanagedCode cannot be tested here because it's a LinkDemand
}
#endif
// we use reflection to call IsolatedStorageFileStream as the Handle and SafeFileHandle
// properties are protected by LinkDemand (which will be converted into full demand,
@@ -259,7 +255,6 @@ namespace MonoCasTests.System.IO.IsolatedStorageTest {
isfs.Close ();
}
}
#if NET_2_0
[Test]
[SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
[ExpectedException (typeof (SecurityException))]
@@ -274,7 +269,6 @@ namespace MonoCasTests.System.IO.IsolatedStorageTest {
isfs.Close ();
}
}
#endif
// async tests (for stack propagation)

View File

@@ -30,9 +30,7 @@
using System;
using System.IO;
using System.IO.IsolatedStorage;
#if NET_2_0
using Microsoft.Win32.SafeHandles;
#endif
using NUnit.Framework;
@@ -50,9 +48,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
Assert.AreEqual (0, isfs.Length, prefix + ".Length");
Assert.AreEqual ("[Unknown]", isfs.Name, prefix + ".Name");
Assert.AreEqual (0, isfs.Position, prefix + ".Position");
#if NET_2_0_NOTYET
Assert.IsFalse (isfs.CanTimeout, prefix + ".CanTimeout");
#endif
}
[Test]
@@ -120,31 +115,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
{
new IsolatedStorageFileStream ("/rootpath", FileMode.Create);
}
#if NET_2_0_NOTYET
[Test]
[ExpectedException (typeof (IsolatedStorageException))]
public void SafeFileHandle_ ()
{
IsolatedStorageFileStream isfs = new IsolatedStorageFileStream ("safeFileHandle", FileMode.Create);
SafeFileHandle sfh = isfs.SafeFileHandle;
}
[Test]
[ExpectedException (typeof (InvalidOperationException))]
public void ReadTimeOut ()
{
IsolatedStorageFileStream isfs = new IsolatedStorageFileStream ("readTimeout", FileMode.Create);
int t = isfs.ReadTimeout;
}
[Test]
[ExpectedException (typeof (InvalidOperationException))]
public void WriteTimeOut ()
{
IsolatedStorageFileStream isfs = new IsolatedStorageFileStream ("writeTimeout", FileMode.Create);
int t = isfs.WriteTimeout;
}
#endif
#if NET_4_0
[Test]

View File

@@ -56,10 +56,8 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
Assert.IsNotNull (isf.AssemblyIdentity, prefix + "AssemblyIdentity");
if ((isf.Scope & IsolatedStorageScope.Domain) != 0)
Assert.IsNotNull (isf.DomainIdentity, prefix + "DomainIdentity");
#if NET_2_0
if ((isf.Scope & IsolatedStorageScope.Application) != 0)
Assert.IsNotNull (isf.ApplicationIdentity, prefix + "ApplicationIdentity");
#endif
}
private void GetEnumerator (IsolatedStorageScope scope)
@@ -100,7 +98,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
// giving more details is bad
GetEnumerator (IsolatedStorageScope.User | IsolatedStorageScope.Assembly | IsolatedStorageScope.Domain | IsolatedStorageScope.Roaming);
}
#if NET_2_0
[Test]
public void GetEnumerator_Machine ()
{
@@ -121,7 +118,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
// we can't enum application
GetEnumerator (IsolatedStorageScope.Application);
}
#endif
[Test]
public void GetUserStoreForAssembly ()
{
@@ -147,7 +143,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
object o = isf.DomainIdentity;
}
#if NET_2_0
[Test]
[ExpectedException (typeof (InvalidOperationException))]
public void GetUserStoreForAssembly_ApplicationIdentity ()
@@ -155,7 +150,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly ();
object o = isf.ApplicationIdentity;
}
#endif
[Test]
public void GetUserStoreForDomain ()
@@ -178,7 +172,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
Assert.IsTrue ((isf.CurrentSize >= 0), "CurrentSize");
}
#if NET_2_0
[Test]
[ExpectedException (typeof (InvalidOperationException))]
public void GetUserStoreForDomain_ApplicationIdentity ()
@@ -230,7 +223,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
object o = isf.DomainIdentity;
}
#endif
#endif
#if NET_4_0
// This is supposed to be working only in SL.

View File

@@ -168,7 +168,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
Assert.AreEqual (Path.DirectorySeparatorChar, nais.PublicSeparatorExternal, "SeparatorExternal");
Assert.AreEqual ('.', nais.PublicSeparatorInternal, "SeparatorInternal");
}
#if NET_2_0
[Test]
[ExpectedException (typeof (InvalidOperationException))]
public void IsolatedStorage_ApplicationIdentity ()
@@ -184,14 +183,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
NonAbstractIsolatedStorage nais = new NonAbstractIsolatedStorage ();
object o = nais.AssemblyIdentity;
}
#else
[Test]
public void IsolatedStorage_AssemblyIdentity ()
{
NonAbstractIsolatedStorage nais = new NonAbstractIsolatedStorage ();
Assert.IsNull (nais.AssemblyIdentity, "AssemblyIdentity");
}
#endif
[Test]
[ExpectedException (typeof (InvalidOperationException))]