f-spot r4693 - in trunk/Tests/src: . Filters



Author: sdelcroix
Date: Wed Jan  7 15:38:37 2009
New Revision: 4693
URL: http://svn.gnome.org/viewvc/f-spot?rev=4693&view=rev

Log:
fix the new test so it builds

Modified:
   trunk/Tests/src/Filters/ColorFilter.cs
   trunk/Tests/src/Filters/JpegFilter.cs
   trunk/Tests/src/Filters/OrientationFilter.cs
   trunk/Tests/src/IBrowsableItem.cs
   trunk/Tests/src/ImageTest.cs

Modified: trunk/Tests/src/Filters/ColorFilter.cs
==============================================================================
--- trunk/Tests/src/Filters/ColorFilter.cs	(original)
+++ trunk/Tests/src/Filters/ColorFilter.cs	Wed Jan  7 15:38:37 2009
@@ -1,48 +1,51 @@
 #if ENABLE_NUNIT
 using NUnit.Framework;
-#endif
+using Gdk;
+using System.IO;
 
-#if ENABLE_NUNIT
-		[TestFixture]
-		public class Tests : ImageTest
+namespace FSpot.Filters.Tests
+{
+	[TestFixture]
+	public class ColorFilterTests : ImageTest
+	{
+		[Test]
+		public void GoGoGadgetStretch ()
 		{
-			[Test]
-			public void GoGoGadgetStretch ()
-			{
-				Process ("autostretch.png");
-			}
+			Process ("autostretch.png");
+		}
 
 #if false
-			[Test]
-			public void StretchRealFile ()
-			{
-				string path = "/home/lewing/Desktop/img_0081.jpg";
-				FilterRequest req = new FilterRequest (path);
-				FilterSet set = new FilterSet ();
-				set.Add (new AutoStretchFilter ());
-				set.Add (new UniqueNameFilter (Path.GetDirectoryName (path)));
-				set.Convert (req);
-				req.Preserve (req.Current);
-			}
+		[Test]
+		public void StretchRealFile ()
+		{
+			string path = "/home/lewing/Desktop/img_0081.jpg";
+			FilterRequest req = new FilterRequest (path);
+			FilterSet set = new FilterSet ();
+			set.Add (new AutoStretchFilter ());
+			set.Add (new UniqueNameFilter (Path.GetDirectoryName (path)));
+			set.Convert (req);
+			req.Preserve (req.Current);
+		}
 #endif
 
-			public void Process (string name)
-			{
-				string path = CreateFile (name, 120);
-				using (FilterRequest req = new FilterRequest (path)) {
-					IFilter filter = new AutoStretchFilter ();
-					Assert.IsTrue (filter.Convert (req), "Filter failed to operate");
-					Assert.IsTrue (System.IO.File.Exists (req.Current.LocalPath),
-						       "Error: Did not create " + req.Current.LocalPath);
-					Assert.IsTrue (new FileInfo (req.Current.LocalPath).Length > 0,
-						       "Error: " + req.Current.LocalPath + "is Zero length");
-					//req.Preserve (req.Current);
-					using (ImageFile img = ImageFile.Create (req.Current)) {
-						Pixbuf pixbuf = img.Load ();
-						Assert.IsNotNull (pixbuf);
-					}
+		public void Process (string name)
+		{
+			string path = CreateFile (name, 120);
+			using (FilterRequest req = new FilterRequest (path)) {
+				IFilter filter = new AutoStretchFilter ();
+				Assert.IsTrue (filter.Convert (req), "Filter failed to operate");
+				Assert.IsTrue (System.IO.File.Exists (req.Current.LocalPath),
+					       "Error: Did not create " + req.Current.LocalPath);
+				Assert.IsTrue (new FileInfo (req.Current.LocalPath).Length > 0,
+					       "Error: " + req.Current.LocalPath + "is Zero length");
+				//req.Preserve (req.Current);
+				using (ImageFile img = ImageFile.Create (req.Current)) {
+					Pixbuf pixbuf = img.Load ();
+					Assert.IsNotNull (pixbuf);
 				}
 			}
 		}
+	}
+}
 #endif	
 

Modified: trunk/Tests/src/Filters/JpegFilter.cs
==============================================================================
--- trunk/Tests/src/Filters/JpegFilter.cs	(original)
+++ trunk/Tests/src/Filters/JpegFilter.cs	Wed Jan  7 15:38:37 2009
@@ -1,74 +1,76 @@
 #if ENABLE_NUNIT
 using NUnit.Framework;
-#endif
+using System;
 
-#if ENABLE_NUNIT
-		[TestFixture]
-		public class Tests : ImageTest
+namespace FSpot.Filters.Tests
+{
+	[TestFixture]
+	public class JpegFilterTests : ImageTest
+	{
+		string [] Names = {
+			"fspot-jpegfilter-test.png",
+			"fspot-jpegfilter-test.jpeg",
+			"fspot-jpegfilter-test.jpg",
+			"fspot-jpegfilter-test.JPG",
+		};
+
+		[Test]
+		public void ResultIsJpeg ()
 		{
-			string [] Names = {
-				"fspot-jpegfilter-test.png",
-				"fspot-jpegfilter-test.jpeg",
-				"fspot-jpegfilter-test.jpg",
-				"fspot-jpegfilter-test.JPG",
-			};
-
-			[Test]
-			public void ResultIsJpeg ()
-			{
-				foreach (string name in Names)
-					ResultIsJpeg (name);
-			}
+			foreach (string name in Names)
+				ResultIsJpeg (name);
+		}
 
-			public void ResultIsJpeg (string name)
-			{
-				string path = CreateFile (name, 48);
-				IFilter filter = new JpegFilter ();
-				FilterRequest req = new FilterRequest (path);
-				filter.Convert (req);
-				using (ImageFile img = new JpegFile (req.Current)) {
-					Assert.IsTrue (img != null, "result is null");
-					Assert.IsTrue (img is JpegFile, "result is not a jpg");
-				}
-				System.IO.File.Delete (path);
+		public void ResultIsJpeg (string name)
+		{
+			string path = CreateFile (name, 48);
+			IFilter filter = new JpegFilter ();
+			FilterRequest req = new FilterRequest (path);
+			filter.Convert (req);
+			using (ImageFile img = new JpegFile (req.Current)) {
+				Assert.IsTrue (img != null, "result is null");
+				Assert.IsTrue (img is JpegFile, "result is not a jpg");
 			}
+			System.IO.File.Delete (path);
+		}
 
-			[Test]
-			public void ExtensionIsJPG ()
-			{
-				foreach (string name in Names)
-					ExtensionIsJPG (name);
-			}
+		[Test]
+		public void ExtensionIsJPG ()
+		{
+			foreach (string name in Names)
+				ExtensionIsJPG (name);
+		}
 
-			public void ExtensionIsJPG (string name)
-			{
-				string path = CreateFile (name, 48);
-				IFilter filter = new JpegFilter ();
-				FilterRequest req = new FilterRequest (path);
-				filter.Convert (req);
-				string extension = System.IO.Path.GetExtension (req.Current.LocalPath).ToLower ();
-				Assert.IsTrue (extension == ".jpg" || extension == ".jpeg", String.Format ("{0} is not a valid extension for Jpeg", extension));
-				System.IO.File.Delete (path);
-			}
+		public void ExtensionIsJPG (string name)
+		{
+			string path = CreateFile (name, 48);
+			IFilter filter = new JpegFilter ();
+			FilterRequest req = new FilterRequest (path);
+			filter.Convert (req);
+			string extension = System.IO.Path.GetExtension (req.Current.LocalPath).ToLower ();
+			Assert.IsTrue (extension == ".jpg" || extension == ".jpeg", String.Format ("{0} is not a valid extension for Jpeg", extension));
+			System.IO.File.Delete (path);
+		}
 
-			[Test]
-			public void OriginalUntouched ()
-			{
-				foreach (string name in Names)
-					OriginalUntouched (name);
-			}
+		[Test]
+		public void OriginalUntouched ()
+		{
+			foreach (string name in Names)
+				OriginalUntouched (name);
+		}
 
-			public void OriginalUntouched (string name)
-			{
-				string path = CreateFile (name, 48);
-				IFilter filter = new JpegFilter ();
-				FilterRequest req = new FilterRequest (path);
-				long original_size = new System.IO.FileInfo (path).Length;
-				filter.Convert (req);
-				long final_size = new System.IO.FileInfo (req.Source.LocalPath).Length;
-				Assert.IsTrue (original_size == final_size, "original is modified !!!");
-				System.IO.File.Delete (path);
-			}
+		public void OriginalUntouched (string name)
+		{
+			string path = CreateFile (name, 48);
+			IFilter filter = new JpegFilter ();
+			FilterRequest req = new FilterRequest (path);
+			long original_size = new System.IO.FileInfo (path).Length;
+			filter.Convert (req);
+			long final_size = new System.IO.FileInfo (req.Source.LocalPath).Length;
+			Assert.IsTrue (original_size == final_size, "original is modified !!!");
+			System.IO.File.Delete (path);
 		}
+	}
+}
 #endif
 

Modified: trunk/Tests/src/Filters/OrientationFilter.cs
==============================================================================
--- trunk/Tests/src/Filters/OrientationFilter.cs	(original)
+++ trunk/Tests/src/Filters/OrientationFilter.cs	Wed Jan  7 15:38:37 2009
@@ -1,17 +1,18 @@
 #if ENABLE_NUNIT
 using NUnit.Framework;
-#endif
-#if ENABLE_NUNIT
-		[TestFixture]
-		public class Tests : ImageTest {
-			[Test]
-			public void TestNoop ()
-			{
-				string path = CreateFile ("test.jpg", 50);
-				FilterRequest req = new FilterRequest (path);
-				IFilter filter = new OrientationFilter ();
-				Assert.IsFalse (filter.Convert (req), "Orientation Filter changed a normal file");
-			}
+namespace FSpot.Filters.Test
+{
+	[TestFixture]
+	public class OrientationFilterTests : ImageTest {
+		[Test]
+		public void TestNoop ()
+		{
+			string path = CreateFile ("test.jpg", 50);
+			FilterRequest req = new FilterRequest (path);
+			IFilter filter = new OrientationFilter ();
+			Assert.IsFalse (filter.Convert (req), "Orientation Filter changed a normal file");
 		}
+	}
+}
 #endif
 

Modified: trunk/Tests/src/IBrowsableItem.cs
==============================================================================
--- trunk/Tests/src/IBrowsableItem.cs	(original)
+++ trunk/Tests/src/IBrowsableItem.cs	Wed Jan  7 15:38:37 2009
@@ -12,8 +12,6 @@
 
 		public IBrowsableItemTests ()
 		{
-			Gnome.Vfs.Vfs.Initialize ();
-
 			collection = new FSpot.UriCollection ();
 			item = new BrowsablePointer (collection, 0);
 			item.Changed += delegate {

Modified: trunk/Tests/src/ImageTest.cs
==============================================================================
--- trunk/Tests/src/ImageTest.cs	(original)
+++ trunk/Tests/src/ImageTest.cs	Wed Jan  7 15:38:37 2009
@@ -13,7 +13,6 @@
 	public class ImageTest {
 		public ImageTest ()
 		{
-			Gnome.Vfs.Vfs.Initialize ();
 			Gtk.Application.Init ();
 		}
 



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