ChangeLog: Updated ChangeLog
authorSanja Gupta <sanjay@mono-cvs.ximian.com>
Fri, 19 Mar 2004 06:24:58 +0000 (06:24 -0000)
committerSanja Gupta <sanjay@mono-cvs.ximian.com>
Fri, 19 Mar 2004 06:24:58 +0000 (06:24 -0000)
TestBitmap.cs: Added test case for exception thrown while saving
   image to same file from which it is read.

svn path=/trunk/mcs/; revision=24320

mcs/class/System.Drawing/Test/System.Drawing/ChangeLog
mcs/class/System.Drawing/Test/System.Drawing/TestBitmap.cs

index eb2e9c37016d5b8abb80299df1719eabe2529713..cdc2d855f3cbfe845452ea8f88b5a2206e78def1 100644 (file)
@@ -1,3 +1,7 @@
+2004-03-19  Sanjay Gupta <gsanjay@novell.com>
+       * TestBitmap.cs: Added a test case to check exception thrown 
+       if the image is saved to same file from which it is read.
+
 2004-03-17  Ravindra <rkumar@novell.com>
        * TestHatchBrush.cs: Added.
 
index 1943b2fe38df30b7fa2b7a79569238591b8a19ed..08628795d60f427529bf58b6d5af37dc7311646d 100644 (file)
@@ -10,6 +10,7 @@
 using System;
 using System.Drawing;
 using System.Drawing.Imaging;
+using System.IO;
 using NUnit.Framework;
 
 namespace MonoTests.System.Drawing{
@@ -82,6 +83,22 @@ namespace MonoTests.System.Drawing{
                        AssertEquals (Color.FromArgb(255,255,0,0), color);                                                                                      
                }
 
+               [Test]
+               [ExpectedException (typeof (IOException))]
+               public void BitmapSaveSameFile() 
+               {                               
+                       string sOutFile = getSubDir() + "linerect.bmp";
+                                                                       
+                       // Load                 
+                       Bitmap  bmpLoad = new Bitmap(sOutFile);
+                       if( bmpLoad == null) 
+                               Console.WriteLine("Unable to load "+ sOutFile);                                         
+                       
+                       //Try saving in the same file
+                       bmpLoad.Save(sOutFile, ImageFormat.Bmp);
+                       
+               }
+
                [Test]
                public void MakeTransparent() 
                {