Imported Upstream version 5.20.0.180

Former-commit-id: ff953ca879339fe1e1211f7220f563e1342e66cb
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-02-04 20:11:37 +00:00
parent 0e2d47d1c8
commit 0510252385
3360 changed files with 83827 additions and 39243 deletions

View File

@ -35,6 +35,8 @@ using System.Security.Permissions;
using System.Text;
using NUnit.Framework;
using MonoTests.Helpers;
namespace MonoTests.System.Drawing.Imaging {
[TestFixture]
@ -59,17 +61,6 @@ namespace MonoTests.System.Drawing.Imaging {
return s;
}
/* Get the input directory depending on the runtime*/
internal string getInFile (string file)
{
string sRslt = Path.GetFullPath ("../System.Drawing/" + file);
if (!File.Exists (sRslt))
sRslt = "Test/System.Drawing/" + file;
return sRslt;
}
private bool IsArm64Process ()
{
if (Environment.OSVersion.Platform != PlatformID.Unix || !Environment.Is64BitProcess)
@ -95,7 +86,7 @@ namespace MonoTests.System.Drawing.Imaging {
[Test]
public void Bitmap1bitFeatures ()
{
string sInFile = getInFile ("bitmaps/1bit.png");
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/1bit.png");
using (Bitmap bmp = new Bitmap (sInFile)) {
GraphicsUnit unit = GraphicsUnit.World;
RectangleF rect = bmp.GetBounds (ref unit);
@ -123,7 +114,7 @@ namespace MonoTests.System.Drawing.Imaging {
[Test]
public void Bitmap1bitPixels ()
{
string sInFile = getInFile ("bitmaps/1bit.png");
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/1bit.png");
using (Bitmap bmp = new Bitmap (sInFile)) {
#if false
for (int x = 0; x < bmp.Width; x += 32) {
@ -205,7 +196,7 @@ namespace MonoTests.System.Drawing.Imaging {
[Test]
public void Bitmap1bitData ()
{
string sInFile = getInFile ("bitmaps/1bit.png");
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/1bit.png");
using (Bitmap bmp = new Bitmap (sInFile)) {
BitmapData data = bmp.LockBits (new Rectangle (0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
try {
@ -314,7 +305,7 @@ namespace MonoTests.System.Drawing.Imaging {
if (IsArm64Process ())
Assert.Ignore ("https://bugzilla.xamarin.com/show_bug.cgi?id=41171");
string sInFile = getInFile ("bitmaps/81674-2bpp.png");
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/81674-2bpp.png");
using (Bitmap bmp = new Bitmap (sInFile)) {
GraphicsUnit unit = GraphicsUnit.World;
RectangleF rect = bmp.GetBounds (ref unit);
@ -346,7 +337,7 @@ namespace MonoTests.System.Drawing.Imaging {
if (IsArm64Process ())
Assert.Ignore ("https://bugzilla.xamarin.com/show_bug.cgi?id=41171");
string sInFile = getInFile ("bitmaps/81674-2bpp.png");
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/81674-2bpp.png");
using (Bitmap bmp = new Bitmap (sInFile)) {
#if false
for (int x = 0; x < bmp.Width; x += 32) {
@ -382,7 +373,7 @@ namespace MonoTests.System.Drawing.Imaging {
if (IsArm64Process ())
Assert.Ignore ("https://bugzilla.xamarin.com/show_bug.cgi?id=41171");
string sInFile = getInFile ("bitmaps/81674-2bpp.png");
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/81674-2bpp.png");
using (Bitmap bmp = new Bitmap (sInFile)) {
BitmapData data = bmp.LockBits (new Rectangle (0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
try {
@ -443,7 +434,7 @@ namespace MonoTests.System.Drawing.Imaging {
[Test]
public void Bitmap4bitFeatures ()
{
string sInFile = getInFile ("bitmaps/4bit.png");
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/4bit.png");
using (Bitmap bmp = new Bitmap (sInFile)) {
GraphicsUnit unit = GraphicsUnit.World;
RectangleF rect = bmp.GetBounds (ref unit);
@ -485,7 +476,7 @@ namespace MonoTests.System.Drawing.Imaging {
[Test]
public void Bitmap4bitPixels ()
{
string sInFile = getInFile ("bitmaps/4bit.png");
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/4bit.png");
using (Bitmap bmp = new Bitmap (sInFile)) {
#if false
for (int x = 0; x < bmp.Width; x += 32) {
@ -568,7 +559,7 @@ namespace MonoTests.System.Drawing.Imaging {
[Test]
public void Bitmap4bitData ()
{
string sInFile = getInFile ("bitmaps/4bit.png");
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/4bit.png");
using (Bitmap bmp = new Bitmap (sInFile)) {
BitmapData data = bmp.LockBits (new Rectangle (0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
try {