Imported Upstream version 5.10.0.69

Former-commit-id: fc39669a0b707dd3c063977486506b6793da2890
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-01-29 19:03:06 +00:00
parent d8f8abd549
commit e2950ec768
6283 changed files with 453847 additions and 91879 deletions

View File

@@ -23,7 +23,6 @@
<Compile Include="$(CommonPath)\System\Security\IdentityHelper.cs">
<Link>Common\System\Security\IdentityHelper.cs</Link>
</Compile>
<Compile Include="System\IO\IsolatedStorage\IsolatedStorageException.Serialization.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' != 'uap'">
<Compile Include="System\IO\IsolatedStorage\Helper.Win32Unix.cs" />

View File

@@ -1,18 +0,0 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Runtime.Serialization;
namespace System.IO.IsolatedStorage
{
[Serializable]
public partial class IsolatedStorageException : Exception
{
protected IsolatedStorageException(SerializationInfo info, StreamingContext context) : base(info, context)
{
throw new PlatformNotSupportedException();
}
}
}

View File

@@ -3,10 +3,13 @@
// See the LICENSE file in the project root for more information.
using System;
using System.Runtime.Serialization;
namespace System.IO.IsolatedStorage
{
public partial class IsolatedStorageException : Exception
[Serializable]
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public class IsolatedStorageException : Exception, ISerializable
{
private const int COR_E_ISOSTORE = unchecked((int)0x80131450);
@@ -17,24 +20,23 @@ namespace System.IO.IsolatedStorage
public IsolatedStorageException()
: base(SR.IsolatedStorage_Exception)
{
SetErrorCode(COR_E_ISOSTORE);
HResult = COR_E_ISOSTORE;
}
public IsolatedStorageException(string message)
: base(message)
{
SetErrorCode(COR_E_ISOSTORE);
HResult = COR_E_ISOSTORE;
}
public IsolatedStorageException(string message, Exception inner)
: base(message, inner)
{
SetErrorCode(COR_E_ISOSTORE);
HResult = COR_E_ISOSTORE;
}
private void SetErrorCode(int hr)
protected IsolatedStorageException(SerializationInfo info, StreamingContext context) : base(info, context)
{
HResult = hr;
}
}
}

View File

@@ -65,6 +65,7 @@ namespace System.IO.IsolatedStorage
}
[Fact]
[SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework)]
public void CopyFile_RaisesInvalidPath()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
@@ -74,6 +75,17 @@ namespace System.IO.IsolatedStorage
}
}
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void CopyFile_RaisesIsolatedStorageException()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
Assert.Throws<IsolatedStorageException>(() => isf.CopyFile("\0bad", "bar"));
Assert.Throws<IsolatedStorageException>(() => isf.CopyFile("foo", "\0bad"));
}
}
[Fact]
public void CopyFile_DoesNotExist()
{

View File

@@ -50,6 +50,7 @@ namespace System.IO.IsolatedStorage
}
[Fact]
[SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework)]
public void CreateDirectory_RaisesArgumentException()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
@@ -58,6 +59,16 @@ namespace System.IO.IsolatedStorage
}
}
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void CreateDirectory_IsolatedStorageException()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
Assert.Throws<IsolatedStorageException>(() => isf.CreateDirectory("\0bad"));
}
}
[Theory, MemberData(nameof(ValidStores))]
[ActiveIssue("dotnet/corefx #18268", TargetFrameworkMonikers.NetFramework)]
public void CreateDirectory_Existance(PresetScopes scope)

View File

@@ -50,6 +50,7 @@ namespace System.IO.IsolatedStorage
}
[Fact]
[SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework)]
public void CreateFile_RaisesArgumentException()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
@@ -58,6 +59,16 @@ namespace System.IO.IsolatedStorage
}
}
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void CreateFile_IsolatedStorageException()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
Assert.Throws<IsolatedStorageException>(() => isf.CreateFile("\0bad"));
}
}
[Theory, MemberData(nameof(ValidStores))]
[ActiveIssue("dotnet/corefx #18268", TargetFrameworkMonikers.NetFramework)]
public void CreateFile_Existence(PresetScopes scope)

View File

@@ -50,6 +50,7 @@ namespace System.IO.IsolatedStorage
}
[Fact]
[SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework)]
public void DirectoryExists_RaisesArgumentException()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
@@ -58,6 +59,16 @@ namespace System.IO.IsolatedStorage
}
}
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void DirectoryExists_False()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
Assert.False(isf.DirectoryExists("\0bad"));
}
}
[Fact]
public void DirectoryExists_Existance()
{

View File

@@ -50,6 +50,7 @@ namespace System.IO.IsolatedStorage
}
[Fact]
[SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework)]
public void FileExists_RaisesArgumentException()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
@@ -58,6 +59,16 @@ namespace System.IO.IsolatedStorage
}
}
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void FileExists_False()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
Assert.False(isf.FileExists("\0bad"));
}
}
[Theory]
[MemberData(nameof(ValidStores))]
[ActiveIssue("dotnet/corefx #18268", TargetFrameworkMonikers.NetFramework)]

View File

@@ -53,7 +53,20 @@ namespace System.IO.IsolatedStorage
}
[Fact]
public void GetFileNames_RaisesInvalidPath()
[ActiveIssue(25428, TestPlatforms.AnyUnix)]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void GetFileNames_RaisesInvalidPath_Core()
{
// We are no longer as agressive with filters for enumerating files
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
isf.GetFileNames("\0bad");
}
}
[Fact]
[SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework)]
public void GetFileNames_RaisesInvalidPath_Desktop()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{

View File

@@ -61,6 +61,7 @@ namespace System.IO.IsolatedStorage
}
[Fact]
[SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework)]
public void MoveDirectory_RaisesInvalidPath()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
@@ -70,6 +71,17 @@ namespace System.IO.IsolatedStorage
}
}
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void MoveDirectory_IsolatedStorageException()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
Assert.Throws<IsolatedStorageException>(() => isf.MoveDirectory("\0bad", "bar"));
Assert.Throws<IsolatedStorageException>(() => isf.MoveDirectory("foo", "\0bad"));
}
}
[Fact]
public void MoveDirectory_DoesNotExist()
{

View File

@@ -62,6 +62,7 @@ namespace System.IO.IsolatedStorage
}
[Fact]
[SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework)]
public void MoveFile_RaisesInvalidPath()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
@@ -71,6 +72,17 @@ namespace System.IO.IsolatedStorage
}
}
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void MoveFile_RaisesIsolatedStorageException()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
Assert.Throws<IsolatedStorageException>(() => isf.MoveFile("\0bad", "bar"));
Assert.Throws<IsolatedStorageException>(() => isf.MoveFile("foo", "\0bad"));
}
}
[Fact]
public void MoveFile_DoesNotExist()
{

View File

@@ -58,6 +58,7 @@ namespace System.IO.IsolatedStorage
}
[Fact]
[SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework)]
public void OpenFile_RaisesArgumentException()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
@@ -68,6 +69,18 @@ namespace System.IO.IsolatedStorage
}
}
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void OpenFile_RaisesIsolatedStorageException()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
Assert.Throws<IsolatedStorageException>(() => isf.OpenFile("\0bad", FileMode.Create));
Assert.Throws<IsolatedStorageException>(() => isf.OpenFile("\0bad", FileMode.Create, FileAccess.ReadWrite));
Assert.Throws<IsolatedStorageException>(() => isf.OpenFile("\0bad", FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite));
}
}
[Fact]
[ActiveIssue("dotnet/corefx #18265", TargetFrameworkMonikers.NetFramework)]
public void OpenFile_PassesFileShare()