Imported Upstream version 5.0.0.42

Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-04-10 11:41:01 +00:00
parent 1190d13a04
commit 6bdd276d05
19939 changed files with 3099680 additions and 93811 deletions

View File

@@ -8,9 +8,7 @@
//
using NUnit.Framework;
#if !MONODROID
using NUnit.Framework.SyntaxHelpers;
#endif
using System;
using System.Text;
using System.Threading;
@@ -21,7 +19,7 @@ using Mono.Unix.Native;
namespace MonoTests.Mono.Unix.Native {
[TestFixture]
[Category ("NotOnMac")]
[Category ("NotOnMac"), Category ("NotOnWindows")]
public class RealTimeSignumTest
{
[Test]

View File

@@ -20,7 +20,7 @@ using NUnit.Framework;
namespace MonoTests.Mono.Unix.Native
{
[TestFixture, Category ("NotDotNet")]
[TestFixture, Category ("NotDotNet"), Category ("NotOnWindows")]
public class SocketTest {
string TempFolder;

View File

@@ -17,7 +17,7 @@ using Mono.Unix.Native;
namespace MonoTests.Mono.Unix.Native {
[TestFixture]
[TestFixture, Category ("NotOnWindows")]
public class StdlibTest
{
private class SignalTest {

View File

@@ -18,7 +18,7 @@ using NUnit.Framework;
namespace MonoTests.Mono.Unix
{
[TestFixture, Category ("NotDotNet")]
[TestFixture, Category ("NotDotNet"), Category ("NotOnWindows")]
public class ReadlinkTest {
static string[] Targets = {
@@ -173,7 +173,7 @@ namespace MonoTests.Mono.Unix
long r = Syscall.readlink (link, buf);
if (r < 0)
UnixMarshal.ThrowExceptionForLastError ();
Assert.GreaterOrEqual (buf.Length, r);
Assert.That(buf.Length, Is.GreaterThanOrEqualTo(r));
if (r == buf.Length)
buf = new byte[checked (buf.Length * 2)];
else
@@ -199,7 +199,7 @@ namespace MonoTests.Mono.Unix
long r = Syscall.readlinkat (TempFD, "link", buf);
if (r < 0)
UnixMarshal.ThrowExceptionForLastError ();
Assert.GreaterOrEqual (buf.Length, r);
Assert.That(buf.Length, Is.GreaterThanOrEqualTo(r));
if (r == buf.Length)
buf = new byte[checked (buf.Length * 2)];
else
@@ -226,7 +226,7 @@ namespace MonoTests.Mono.Unix
if (r < 0)
UnixMarshal.ThrowExceptionForLastError ();
Assert.AreEqual (r, sb.Length);
Assert.GreaterOrEqual (sb.Capacity, r);
Assert.That(sb.Capacity, Is.GreaterThanOrEqualTo(r));
if (r == sb.Capacity)
checked { sb.Capacity *= 2; }
else
@@ -255,7 +255,7 @@ namespace MonoTests.Mono.Unix
if (r < 0)
UnixMarshal.ThrowExceptionForLastError ();
Assert.AreEqual (r, sb.Length);
Assert.GreaterOrEqual (sb.Capacity, r);
Assert.That(sb.Capacity, Is.GreaterThanOrEqualTo(r));
if (r == sb.Capacity)
checked { sb.Capacity *= 2; }
else

View File

@@ -21,25 +21,43 @@ namespace MonoTests.System.IO
[TestFixture]
public class StdioFileStreamTest {
string TempFolder = Path.Combine (Path.GetTempPath (), "MonoTests.Mono.Unix.Tests");
static string BaseTempFolder = Path.Combine (Path.GetTempPath (),
"MonoTests.Mono.Unix.Tests");
static string TempFolder;
static readonly char DSC = Path.DirectorySeparatorChar;
[TearDown]
public void TearDown()
[TestFixtureSetUp]
public void FixtureSetUp ()
{
if (Directory.Exists (TempFolder))
Directory.Delete (TempFolder, true);
try {
// Try to cleanup from any previous NUnit run.
Directory.Delete (BaseTempFolder, true);
} catch (Exception) {
}
}
[SetUp]
public void SetUp ()
{
if (Directory.Exists (TempFolder))
Directory.Delete (TempFolder, true);
int i = 0;
do {
TempFolder = Path.Combine (BaseTempFolder, (++i).ToString());
} while (Directory.Exists (TempFolder));
Directory.CreateDirectory (TempFolder);
}
[TearDown]
public void TearDown ()
{
try {
// This might throw an exception on Windows
// since the directory may contain open files.
Directory.Delete (TempFolder, true);
} catch (Exception e) {
Console.WriteLine (e);
}
}
public void TestCtr ()
{
string path = TempFolder + DSC + "testfilestream.tmp.1";
@@ -226,7 +244,7 @@ namespace MonoTests.System.IO
{
StdioFileStream fs = null;
StdioFileStream fs2 = null;
string tempPath = Path.Combine (Path.GetTempPath (), "temp");
string tempPath = Path.Combine (TempFolder, "temp");
try {
if (!File.Exists (tempPath)) {
TextWriter tw = File.CreateText (tempPath);
@@ -240,8 +258,6 @@ namespace MonoTests.System.IO
fs.Close ();
if (fs2 != null)
fs2.Close ();
if (File.Exists (tempPath))
File.Delete (tempPath);
}
}
@@ -273,8 +289,9 @@ namespace MonoTests.System.IO
stream.Write (outbytes, 7, 7);
stream.Write (outbytes, 14, 1);
stream.Read (bytes, 0, 15);
stream.Seek (15, SeekOrigin.Begin);
Array.Clear (bytes, 0, bytes.Length);
stream.Read (bytes, 0, 15);
for (int i = 0; i < 15; ++i)
Assert.AreEqual (i + 1, bytes [i]);
stream.Close ();

View File

@@ -17,7 +17,7 @@ using Mono.Unix;
namespace MonoTests.Mono.Unix {
[TestFixture]
[TestFixture, Category ("NotOnWindows")]
public class UnixEndPointTest {
// Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=35004

View File

@@ -21,7 +21,7 @@ using Syscall = Mono.Unix.Native.Syscall;
namespace MonoTests.Mono.Unix {
[TestFixture, Category ("NotDotNet")]
[TestFixture, Category ("NotDotNet"), Category ("NotOnWindows")]
public class UnixGroupTest
{
[Test]

View File

@@ -14,7 +14,7 @@ using Mono.Unix;
namespace MonoTests.Mono.Unix {
[TestFixture]
[TestFixture, Category ("NotOnWindows")]
public class UnixListenerTest {
// test that a socket file is created and deleted by the UnixListener

View File

@@ -28,7 +28,7 @@ namespace MonoTests.Mono.Unix {
}
}
[TestFixture]
[TestFixture, Category ("NotOnWindows")]
public class UnixMarshalTest {
#if false
public static void Main ()

View File

@@ -16,7 +16,7 @@ using Mono.Unix;
namespace MonoTests.Mono.Unix
{
[TestFixture, Category ("NotDotNet")]
[TestFixture, Category ("NotDotNet"), Category ("NotOnWindows")]
public class UnixPathTest {
private static readonly char DSC = UnixPath.DirectorySeparatorChar;

View File

@@ -8,21 +8,17 @@
//
using NUnit.Framework;
#if !MONODROID
using NUnit.Framework.SyntaxHelpers;
#endif
using System;
using System.Text;
using System.Threading;
using Mono.Unix;
using Mono.Unix.Android;
using Mono.Unix.Native;
#if !MONODROID
namespace NUnit.Framework.SyntaxHelpers { class Dummy {} }
#endif
namespace MonoTests.Mono.Unix {
[TestFixture]
[TestFixture, Category ("NotOnWindows")]
public class UnixSignalTest {
// helper method to create a thread waiting on a UnixSignal

View File

@@ -21,7 +21,7 @@ using Syscall = Mono.Unix.Native.Syscall;
namespace MonoTests.Mono.Unix {
[TestFixture, Category ("NotDotNet")]
[TestFixture, Category ("NotDotNet"), Category ("NotOnWindows")]
public class UnixUserTest
{
[Test]