f-spot r4707 - in trunk: . Tests/src/Imaging src/Imaging



Author: sdelcroix
Date: Thu Feb 12 14:32:46 2009
New Revision: 4707
URL: http://svn.gnome.org/viewvc/f-spot?rev=4707&view=rev

Log:
2009-02-12  Stephane Delcroix  <sdelcroix novell com>

	* src/Imaging/JpegFile.cs: move the tests to Test/

Added:
   trunk/Tests/src/Imaging/JpegFile.cs
Modified:
   trunk/ChangeLog
   trunk/src/Imaging/JpegFile.cs

Added: trunk/Tests/src/Imaging/JpegFile.cs
==============================================================================
--- (empty file)
+++ trunk/Tests/src/Imaging/JpegFile.cs	Thu Feb 12 14:32:46 2009
@@ -0,0 +1,45 @@
+//Author: Larry
+#if ENABLE_NUNIT
+		[TestFixture]
+		public class Tests {
+			public Tests ()
+			{
+				Gnome.Vfs.Vfs.Initialize ();
+				Gtk.Application.Init ();
+			}
+			
+#if false
+			[Test]
+			public void TestLoad ()
+			{
+				JpegFile jimg = new JpegFile ("/home/lewing/start.swe.jpeg");
+				Assert.AreEqual (PixbufOrientation.TopLeft, jimg.Orientation);
+			}
+#endif
+			[Test]
+			public void TestSave ()
+			{
+				string desc = "this is an example description";
+				string desc2 = "\x00a9 Novell Inc.";
+				PixbufOrientation orient = PixbufOrientation.TopRight;
+				Gdk.Pixbuf test = new Gdk.Pixbuf (null, "f-spot-32.png");
+				string path = ImageFile.TempPath ("joe.jpg");
+				
+				PixbufUtils.SaveJpeg (test, path, 75, new Exif.ExifData ());
+				JpegFile jimg = new JpegFile (path);
+				jimg.SetDescription (desc);
+				jimg.SetOrientation (orient);
+				jimg.SaveMetaData (path);
+				JpegFile mod = new JpegFile (path);
+				Assert.AreEqual (mod.Orientation, orient);
+				Assert.AreEqual (mod.Description, desc);
+				jimg.SetDescription (desc2);
+				jimg.SaveMetaData (path);
+				mod = new JpegFile (path);
+				Assert.AreEqual (mod.Description, desc2);
+				
+				File.Delete (path);
+			}
+		}
+#endif
+

Modified: trunk/src/Imaging/JpegFile.cs
==============================================================================
--- trunk/src/Imaging/JpegFile.cs	(original)
+++ trunk/src/Imaging/JpegFile.cs	Thu Feb 12 14:32:46 2009
@@ -4,10 +4,6 @@
 using FSpot.Xmp;
 using FSpot.Tiff;
 
-#if ENABLE_NUNIT
-using NUnit.Framework;
-#endif
-
 namespace FSpot {
 	public interface IThumbnailContainer {
 		Gdk.Pixbuf GetEmbeddedThumbnail ();
@@ -348,48 +344,5 @@
 			}
 		}
 
-#if ENABLE_NUNIT
-		[TestFixture]
-		public class Tests {
-			public Tests ()
-			{
-				Gnome.Vfs.Vfs.Initialize ();
-				Gtk.Application.Init ();
-			}
-			
-#if false
-			[Test]
-			public void TestLoad ()
-			{
-				JpegFile jimg = new JpegFile ("/home/lewing/start.swe.jpeg");
-				Assert.AreEqual (PixbufOrientation.TopLeft, jimg.Orientation);
-			}
-#endif
-			[Test]
-			public void TestSave ()
-			{
-				string desc = "this is an example description";
-				string desc2 = "\x00a9 Novell Inc.";
-				PixbufOrientation orient = PixbufOrientation.TopRight;
-				Gdk.Pixbuf test = new Gdk.Pixbuf (null, "f-spot-32.png");
-				string path = ImageFile.TempPath ("joe.jpg");
-				
-				PixbufUtils.SaveJpeg (test, path, 75, new Exif.ExifData ());
-				JpegFile jimg = new JpegFile (path);
-				jimg.SetDescription (desc);
-				jimg.SetOrientation (orient);
-				jimg.SaveMetaData (path);
-				JpegFile mod = new JpegFile (path);
-				Assert.AreEqual (mod.Orientation, orient);
-				Assert.AreEqual (mod.Description, desc);
-				jimg.SetDescription (desc2);
-				jimg.SaveMetaData (path);
-				mod = new JpegFile (path);
-				Assert.AreEqual (mod.Description, desc2);
-				
-				File.Delete (path);
-			}
-		}
-#endif
 	}
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]