Imported Upstream version 6.0.0.197

Former-commit-id: ce8df4f105a5e534ae52c5975c6525634631b55b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-04-25 08:34:32 +00:00
parent b8f7d9129e
commit 91848d672d
62 changed files with 72 additions and 47 deletions

View File

@@ -315,12 +315,14 @@ namespace System.IO.Tests
Assert.False(Exists(component));
}
#if !MONODROID
[Theory,
MemberData(nameof(UncPathsWithoutShareName))]
public void UncPathWithoutShareNameAsPath_ReturnsFalse(string component)
{
Assert.False(Exists(component));
}
#endif
[Fact]
[PlatformSpecific(TestPlatforms.Windows)] // max directory length not fixed on Unix

View File

@@ -905,6 +905,7 @@ namespace System.IO.Tests
});
}
#if !MONODROID
[Fact]
[PlatformSpecific(TestPlatforms.AnyUnix)] // Unix-invalid search patterns throws no exception
public void UnixSearchPatternInvalid()
@@ -912,6 +913,7 @@ namespace System.IO.Tests
GetEntries(TestDirectory, "\0");
GetEntries(TestDirectory, string.Format("te{0}st", "\0".ToString()));
}
#endif
[Fact]
[PlatformSpecific(TestPlatforms.Windows)] // ? in search pattern returns results
@@ -986,6 +988,7 @@ namespace System.IO.Tests
}
}
#if !MONODROID
[Theory,
InlineData(" "),
InlineData(" "),
@@ -1024,6 +1027,7 @@ namespace System.IO.Tests
Assert.Contains(Path.Combine(testDir.FullName, valid), GetEntries(testDir.FullName, valid));
}
}
#endif
#endregion
}

View File

@@ -8,12 +8,14 @@ namespace System.IO.Tests
{
public class DirectoryInfo_Name : FileSystemTest
{
#if !MONODROID
[Fact]
public void CurrentDirectory()
{
var info = new DirectoryInfo(".");
Assert.Equal(Path.GetFileName(Directory.GetCurrentDirectory()), info.Name);
}
#endif
[Fact]
public void UNCShareName()

View File

@@ -247,12 +247,14 @@ namespace System.IO.Tests
Assert.False(Exists(component));
}
#if !MONODROID
[Theory,
MemberData(nameof(UncPathsWithoutShareName))]
public void UncPathWithoutShareNameAsPath_ReturnsFalse(string component)
{
Assert.False(Exists(component));
}
#endif
[Theory,
MemberData(nameof(PathsWithComponentLongerThanMaxComponent))]

View File

@@ -130,6 +130,7 @@ namespace System.IO.Tests
Assert.Equal(0, File.ReadAllBytes(path).Length);
}
#if !MONODROID
[Theory]
[PlatformSpecific(TestPlatforms.Linux)]
[InlineData("/proc/cmdline")]
@@ -173,5 +174,6 @@ namespace System.IO.Tests
{
Assert.InRange(File.ReadAllBytes(path).Length, 1, int.MaxValue);
}
#endif
}
}

View File

@@ -144,6 +144,7 @@ namespace System.IO.Tests
Assert.Equal(0, (await File.ReadAllBytesAsync(path)).Length);
}
#if !MONODROID
[Theory]
[PlatformSpecific(TestPlatforms.Linux)]
[InlineData("/proc/cmdline")]
@@ -187,5 +188,6 @@ namespace System.IO.Tests
{
Assert.InRange((await File.ReadAllBytesAsync(path)).Length, 1, int.MaxValue);
}
#endif
}
}

View File

@@ -29,6 +29,7 @@ namespace System.IO.Tests
Assert.False(File.Exists(fileName));
}
#if !MONODROID
[Fact]
public void FileShareDeleteNewRename()
{
@@ -42,6 +43,7 @@ namespace System.IO.Tests
Assert.True(File.Exists(newFileName));
}
}
#endif
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.Mono, "CoreFX FileStream not yet imported")]
@@ -67,6 +69,7 @@ namespace System.IO.Tests
Assert.False(File.Exists(fileName));
}
#if !MONODROID
[Fact]
public void FileShareDeleteExistingRename()
{
@@ -86,6 +89,7 @@ namespace System.IO.Tests
Assert.True(File.Exists(newFileName));
}
}
#endif
[Fact]
[PlatformSpecific(TestPlatforms.Windows)] // file sharing restriction limitations on Unix

View File

@@ -218,6 +218,7 @@ namespace System.Reflection.Tests
public static IEnumerable<object[]> Methods =>
Module.GetMethods().Select(m => new object[] { m });
#if !MONODROID
[Theory]
[MemberData(nameof(Methods))]
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "Module.Resolve apis not supported on UapAot.")]
@@ -225,6 +226,7 @@ namespace System.Reflection.Tests
{
Assert.Equal(t, Module.ResolveMethod(t.MetadataToken));
}
#endif
public static IEnumerable<object[]> BadResolveMethods =>
new[]
@@ -248,6 +250,7 @@ namespace System.Reflection.Tests
public static IEnumerable<object[]> Fields =>
Module.GetFields().Select(f => new object[] { f });
#if !MONODROID
[Theory]
[MemberData(nameof(Fields))]
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "Module.Resolve apis not supported on UapAot.")]
@@ -255,6 +258,7 @@ namespace System.Reflection.Tests
{
Assert.Equal(t, Module.ResolveField(t.MetadataToken));
}
#endif
public static IEnumerable<object[]> BadResolveFields =>
new[]