You've already forked linux-packaging-mono
Imported Upstream version 5.20.0.180
Former-commit-id: ff953ca879339fe1e1211f7220f563e1342e66cb
This commit is contained in:
parent
0e2d47d1c8
commit
0510252385
@@ -35,6 +35,7 @@ using System.Security.Permissions;
|
||||
using System.Text;
|
||||
using NUnit.Framework;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
namespace MonoTests.System.Drawing.Imaging {
|
||||
|
||||
[TestFixture]
|
||||
@@ -59,17 +60,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;
|
||||
}
|
||||
|
||||
/* Checks bitmap features on a know 1bbp bitmap */
|
||||
/* Checks bitmap features on a know 1bbp bitmap */
|
||||
private void Bitmap8bitsFeatures (string filename)
|
||||
@@ -95,13 +85,13 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Bitmap8bitsFeatures_Gif89 ()
|
||||
{
|
||||
Bitmap8bitsFeatures (getInFile ("bitmaps/nature24bits.gif"));
|
||||
Bitmap8bitsFeatures (TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/nature24bits.gif"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Bitmap8bitsFeatures_Gif87 ()
|
||||
{
|
||||
Bitmap8bitsFeatures (getInFile ("bitmaps/nature24bits87.gif"));
|
||||
Bitmap8bitsFeatures (TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/nature24bits87.gif"));
|
||||
}
|
||||
|
||||
private void Bitmap8bitsPixels (string filename)
|
||||
@@ -137,19 +127,19 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Bitmap8bitsPixels_Gif89 ()
|
||||
{
|
||||
Bitmap8bitsPixels (getInFile ("bitmaps/nature24bits.gif"));
|
||||
Bitmap8bitsPixels (TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/nature24bits.gif"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Bitmap8bitsPixels_Gif87 ()
|
||||
{
|
||||
Bitmap8bitsPixels (getInFile ("bitmaps/nature24bits87.gif"));
|
||||
Bitmap8bitsPixels (TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/nature24bits87.gif"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Bitmap8bitsData ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/nature24bits.gif");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/nature24bits.gif");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
BitmapData data = bmp.LockBits (new Rectangle (0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
|
||||
try {
|
||||
@@ -212,7 +202,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Interlaced ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/81773-interlaced.gif");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/81773-interlaced.gif");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
for (int i = 0; i < 255; i++) {
|
||||
Color c = bmp.GetPixel (0, i);
|
||||
|
@@ -1 +1 @@
|
||||
31c8341496836d547566eaa10c9ed628d5763137
|
||||
3d0ecd17dde259c819533beea93ec1983a69f31f
|
@@ -35,25 +35,16 @@ using System.Runtime.InteropServices;
|
||||
using System.Security.Permissions;
|
||||
using NUnit.Framework;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.Drawing.Imaging {
|
||||
|
||||
[TestFixture]
|
||||
public class MetafileTest {
|
||||
|
||||
public const string Bitmap = "bitmaps/non-inverted.bmp";
|
||||
public const string WmfPlaceable = "bitmaps/telescope_01.wmf";
|
||||
public const string Emf = "bitmaps/milkmateya01.emf";
|
||||
|
||||
// Get the input directory depending on the runtime
|
||||
static public string getInFile (string file)
|
||||
{
|
||||
string sRslt = Path.GetFullPath ("../System.Drawing/" + file);
|
||||
|
||||
if (!File.Exists (sRslt))
|
||||
sRslt = "Test/System.Drawing/" + file;
|
||||
|
||||
return sRslt;
|
||||
}
|
||||
public static string Bitmap = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/non-inverted.bmp");
|
||||
public static string WmfPlaceable = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/telescope_01.wmf");
|
||||
public static string Emf = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/milkmateya01.emf");
|
||||
|
||||
[Test]
|
||||
public void Metafile_Stream_Null ()
|
||||
@@ -76,14 +67,14 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Metafile_String_FileDoesNotExists ()
|
||||
{
|
||||
string filename = getInFile ("telescope_02.wmf");
|
||||
string filename = "non_existing.wmf";
|
||||
Assert.Throws<ExternalException> (() => new Metafile (filename));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Metafile_String ()
|
||||
{
|
||||
string filename = getInFile (WmfPlaceable);
|
||||
string filename = WmfPlaceable;
|
||||
Metafile mf = new Metafile (filename);
|
||||
Metafile clone = (Metafile) mf.Clone ();
|
||||
}
|
||||
@@ -91,7 +82,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void GetMetafileHeader_Bitmap ()
|
||||
{
|
||||
Assert.Throws<ExternalException> (() => new Metafile (getInFile (Bitmap)));
|
||||
Assert.Throws<ExternalException> (() => new Metafile (Bitmap));
|
||||
}
|
||||
|
||||
static public void Check_MetaHeader_WmfPlaceable (MetaHeader mh)
|
||||
@@ -138,7 +129,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void GetMetafileHeader_WmfPlaceable ()
|
||||
{
|
||||
using (Metafile mf = new Metafile (getInFile (WmfPlaceable))) {
|
||||
using (Metafile mf = new Metafile (WmfPlaceable)) {
|
||||
MetafileHeader header1 = mf.GetMetafileHeader ();
|
||||
Check_MetafileHeader_WmfPlaceable (header1);
|
||||
|
||||
@@ -150,7 +141,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void GetMetafileHeader_FromFile_WmfPlaceable ()
|
||||
{
|
||||
using (Metafile mf = new Metafile (getInFile (WmfPlaceable))) {
|
||||
using (Metafile mf = new Metafile (WmfPlaceable)) {
|
||||
MetafileHeader header1 = mf.GetMetafileHeader ();
|
||||
Check_MetafileHeader_WmfPlaceable (header1);
|
||||
|
||||
@@ -165,7 +156,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void GetMetafileHeader_FromFileStream_WmfPlaceable ()
|
||||
{
|
||||
using (FileStream fs = File.OpenRead (getInFile (WmfPlaceable))) {
|
||||
using (FileStream fs = File.OpenRead (WmfPlaceable)) {
|
||||
using (Metafile mf = new Metafile (fs)) {
|
||||
MetafileHeader header1 = mf.GetMetafileHeader ();
|
||||
Check_MetafileHeader_WmfPlaceable (header1);
|
||||
@@ -183,7 +174,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
public void GetMetafileHeader_FromMemoryStream_WmfPlaceable ()
|
||||
{
|
||||
MemoryStream ms;
|
||||
string filename = getInFile (WmfPlaceable);
|
||||
string filename = WmfPlaceable;
|
||||
using (FileStream fs = File.OpenRead (filename)) {
|
||||
byte[] data = new byte[fs.Length];
|
||||
fs.Read (data, 0, data.Length);
|
||||
@@ -243,7 +234,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void GetMetafileHeader_FromFile_Emf ()
|
||||
{
|
||||
using (Metafile mf = new Metafile (getInFile (Emf))) {
|
||||
using (Metafile mf = new Metafile (Emf)) {
|
||||
MetafileHeader header1 = mf.GetMetafileHeader ();
|
||||
Check_MetafileHeader_Emf (header1);
|
||||
}
|
||||
@@ -252,7 +243,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void GetMetafileHeader_FromFileStream_Emf ()
|
||||
{
|
||||
using (FileStream fs = File.OpenRead (getInFile (Emf))) {
|
||||
using (FileStream fs = File.OpenRead (Emf)) {
|
||||
using (Metafile mf = new Metafile (fs)) {
|
||||
MetafileHeader header1 = mf.GetMetafileHeader ();
|
||||
Check_MetafileHeader_Emf (header1);
|
||||
@@ -264,7 +255,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
public void GetMetafileHeader_FromMemoryStream_Emf ()
|
||||
{
|
||||
MemoryStream ms;
|
||||
string filename = getInFile (Emf);
|
||||
string filename = Emf;
|
||||
using (FileStream fs = File.OpenRead (filename)) {
|
||||
byte[] data = new byte[fs.Length];
|
||||
fs.Read (data, 0, data.Length);
|
||||
@@ -286,7 +277,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Static_GetMetafileHeader_Stream ()
|
||||
{
|
||||
string filename = getInFile (WmfPlaceable);
|
||||
string filename = WmfPlaceable;
|
||||
using (FileStream fs = File.OpenRead (filename)) {
|
||||
MetafileHeader header = Metafile.GetMetafileHeader (fs);
|
||||
Check_MetafileHeader_WmfPlaceable (header);
|
||||
@@ -302,7 +293,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Static_GetMetafileHeader_Filename ()
|
||||
{
|
||||
string filename = getInFile (WmfPlaceable);
|
||||
string filename = WmfPlaceable;
|
||||
MetafileHeader header = Metafile.GetMetafileHeader (filename);
|
||||
Check_MetafileHeader_WmfPlaceable (header);
|
||||
}
|
||||
@@ -332,7 +323,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Static_GetMetafileHeader_IntPtr ()
|
||||
{
|
||||
string filename = MetafileTest.getInFile (MetafileTest.WmfPlaceable);
|
||||
string filename = MetafileTest.WmfPlaceable;
|
||||
using (Metafile mf = new Metafile (filename)) {
|
||||
|
||||
IntPtr hemf = mf.GetHenhmetafile ();
|
||||
|
@@ -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 {
|
||||
|
@@ -37,6 +37,8 @@ using System.Security.Cryptography;
|
||||
using System.Security.Permissions;
|
||||
using System.Text;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.Drawing.Imaging {
|
||||
|
||||
[TestFixture]
|
||||
@@ -61,22 +63,11 @@ 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;
|
||||
}
|
||||
|
||||
/* Checks bitmap features on a know 1bbp bitmap */
|
||||
[Test]
|
||||
public void Bitmap1bitFeatures ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/almogaver1bit.bmp");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/almogaver1bit.bmp");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
GraphicsUnit unit = GraphicsUnit.World;
|
||||
RectangleF rect = bmp.GetBounds (ref unit);
|
||||
@@ -99,7 +90,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Bitmap1bitPixels ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/almogaver1bit.bmp");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/almogaver1bit.bmp");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
#if false
|
||||
for (int x = 0; x < bmp.Width; x += 32) {
|
||||
@@ -152,7 +143,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Bitmap8bitFeatures ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/almogaver8bits.bmp");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/almogaver8bits.bmp");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
GraphicsUnit unit = GraphicsUnit.World;
|
||||
RectangleF rect = bmp.GetBounds (ref unit);
|
||||
@@ -174,7 +165,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Bitmap8bitPixels ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/almogaver8bits.bmp");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/almogaver8bits.bmp");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
#if false
|
||||
for (int x = 0; x < bmp.Width; x += 32) {
|
||||
@@ -228,7 +219,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Bitmap24bitFeatures()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/almogaver24bits.bmp");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/almogaver24bits.bmp");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
GraphicsUnit unit = GraphicsUnit.World;
|
||||
RectangleF rect = bmp.GetBounds (ref unit);
|
||||
@@ -250,7 +241,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Bitmap24bitPixels ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/almogaver24bits.bmp");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/almogaver24bits.bmp");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
#if false
|
||||
for (int x = 0; x < bmp.Width; x += 32) {
|
||||
@@ -301,7 +292,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Bitmap24bitData ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/almogaver24bits.bmp");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/almogaver24bits.bmp");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
Assert.AreEqual (-3355456, bmp.GetPixel (163, 1).ToArgb (), "163,1");
|
||||
BitmapData data = bmp.LockBits (new Rectangle (0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
|
||||
@@ -428,7 +419,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Bitmap32bitFeatures ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/almogaver32bits.bmp");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/almogaver32bits.bmp");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
GraphicsUnit unit = GraphicsUnit.World;
|
||||
RectangleF rect = bmp.GetBounds (ref unit);
|
||||
@@ -449,7 +440,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Bitmap32bitPixels ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/almogaver32bits.bmp");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/almogaver32bits.bmp");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
Assert.AreEqual (PixelFormat.Format32bppRgb, bmp.PixelFormat, "PixelFormat");
|
||||
#if false
|
||||
@@ -584,7 +575,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
public void NonInvertedBitmap ()
|
||||
{
|
||||
// regression check against http://bugzilla.ximian.com/show_bug.cgi?id=80751
|
||||
string sInFile = getInFile ("bitmaps/non-inverted.bmp");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/non-inverted.bmp");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
GraphicsUnit unit = GraphicsUnit.World;
|
||||
RectangleF rect = bmp.GetBounds (ref unit);
|
||||
|
@@ -35,6 +35,8 @@ using NUnit.Framework;
|
||||
using System.IO;
|
||||
using System.Security.Permissions;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.Drawing.Imaging {
|
||||
|
||||
[TestFixture]
|
||||
@@ -59,21 +61,10 @@ 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;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Bitmap8bbpIndexedGreyscaleFeatures ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/nature-greyscale.jpg");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/nature-greyscale.jpg");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
GraphicsUnit unit = GraphicsUnit.World;
|
||||
RectangleF rect = bmp.GetBounds (ref unit);
|
||||
@@ -112,7 +103,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Bitmap8bbpIndexedGreyscalePixels ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/nature-greyscale.jpg");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/nature-greyscale.jpg");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
#if false
|
||||
for (int x = 0; x < bmp.Width; x += 32) {
|
||||
@@ -144,7 +135,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Bitmap8bbpIndexedGreyscaleData ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/nature-greyscale.jpg");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/nature-greyscale.jpg");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
BitmapData data = bmp.LockBits (new Rectangle (0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
|
||||
try {
|
||||
@@ -207,7 +198,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Bitmap24bitFeatures ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/nature24bits.jpg");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/nature24bits.jpg");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
GraphicsUnit unit = GraphicsUnit.World;
|
||||
RectangleF rect = bmp.GetBounds (ref unit);
|
||||
@@ -238,7 +229,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Bitmap24bitPixels ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/nature24bits.jpg");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/nature24bits.jpg");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
#if false
|
||||
for (int x = 0; x < bmp.Width; x += 32) {
|
||||
@@ -270,7 +261,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Bitmap24bitData ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/almogaver24bits.bmp");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/almogaver24bits.bmp");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
BitmapData data = bmp.LockBits (new Rectangle (0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
|
||||
try {
|
||||
|
@@ -2,7 +2,7 @@
|
||||
// TIFF Codec class testing unit
|
||||
//
|
||||
// Authors:
|
||||
// Jordi Mas i Hern<72>ndez (jordi@ximian.com)
|
||||
// Jordi Mas i Hern<72>ndez (jordi@ximian.com)
|
||||
// Sebastien Pouliot <sebastien@ximian.com>
|
||||
//
|
||||
// Copyright (C) 2006, 2007 Novell, Inc (http://www.novell.com)
|
||||
@@ -35,6 +35,8 @@ using System.Security.Permissions;
|
||||
using System.Text;
|
||||
using NUnit.Framework;
|
||||
|
||||
using MonoTests.Helpers;
|
||||
|
||||
namespace MonoTests.System.Drawing.Imaging {
|
||||
|
||||
[TestFixture]
|
||||
@@ -65,22 +67,11 @@ 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;
|
||||
}
|
||||
|
||||
/* Checks bitmap features on a know 32bbp bitmap */
|
||||
[Test]
|
||||
public void Bitmap32bitsFeatures ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/almogaver32bits.tif");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/almogaver32bits.tif");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
GraphicsUnit unit = GraphicsUnit.World;
|
||||
RectangleF rect = bmp.GetBounds (ref unit);
|
||||
@@ -102,7 +93,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Bitmap32bitsPixels ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/almogaver32bits.tif");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/almogaver32bits.tif");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
#if false
|
||||
for (int x = 0; x < bmp.Width; x += 32) {
|
||||
@@ -154,7 +145,7 @@ namespace MonoTests.System.Drawing.Imaging {
|
||||
[Test]
|
||||
public void Bitmap32bitsData ()
|
||||
{
|
||||
string sInFile = getInFile ("bitmaps/almogaver32bits.tif");
|
||||
string sInFile = TestResourceHelper.GetFullPathOfResource ("Test/System.Drawing/bitmaps/almogaver32bits.tif");
|
||||
using (Bitmap bmp = new Bitmap (sInFile)) {
|
||||
BitmapData data = bmp.LockBits (new Rectangle (0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
|
||||
try {
|
||||
|
Reference in New Issue
Block a user