[TestFixture]
[SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public class TestBitmap {
[Test]
#if NET_2_0
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_BitmapData_Null ()
{
-#if !TARGET_JVM
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format32bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
bmp.LockBits (rect, ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb, null);
}
-#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_32_32_BitmapData ()
{
-#if !TARGET_JVM
BitmapData data = new BitmapData ();
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format32bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
Assert.AreEqual (100, data.Width, "Width");
bmp.UnlockBits (data);
}
-#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_32_24_BitmapData ()
{
-#if !TARGET_JVM
BitmapData data = new BitmapData ();
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format32bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
Assert.AreEqual (100, data.Width, "Width");
bmp.UnlockBits (data);
}
-#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_24_24_BitmapData ()
{
-#if !TARGET_JVM
BitmapData data = new BitmapData ();
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format24bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
Assert.AreEqual (100, data.Width, "Width");
bmp.UnlockBits (data);
}
-#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_24_32_BitmapData ()
{
-#if !TARGET_JVM
BitmapData data = new BitmapData ();
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format24bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
Assert.AreEqual (100, data.Width, "Width");
bmp.UnlockBits (data);
}
-#endif
}
#endif
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void FileDoesNotExists ()
{
Bitmap bmp = new Bitmap ("FileDoesNotExists.jpg");
hash = new MD5CryptoServiceProvider().ComputeHash (pixels);
return ByteArrayToString (hash);
}
-#if !TARGET_JVM
public string RotateIndexedBmp (Bitmap src, RotateFlipType type)
{
int pixels_per_byte;
byte[] hash = new MD5CryptoServiceProvider().ComputeHash (pixel_data);
return ByteArrayToString (hash);
}
-#endif
/*
}
-#if !TARGET_JVM
/*
Rotate 1- and 4-bit bitmaps in different ways and check the
resulting pixels using MD5
}
}
}
-#endif
[Test]
public void DefaultFormat1 ()
{
}
[TestFixture]
-#if TARGET_JVM
- [Ignore ("Unsafe code is not supported")]
-#endif
public class BitmapFullTrustTest {
-#if !TARGET_JVM
[Test]
public void BitmapIntIntIntPixelFormatIntPtrCtor ()
{
Assert.IsTrue (image2.RawFormat.Equals (ImageFormat.MemoryBmp), "2.RawFormat");
}
}
-#endif
}
}