[f-spot] Increase MAX_SCHEME_LENGTH to handle gphoto2 URIs.



commit b49c7a0f34edd216af2fe0f606f7995c31463b39
Author: Ruben Vermeersch <ruben savanne be>
Date:   Tue Jul 13 12:32:06 2010 +0200

    Increase MAX_SCHEME_LENGTH to handle gphoto2 URIs.
    
    Might solve https://bugzilla.gnome.org/show_bug.cgi?id=624181

 src/Utils/SafeUri.cs            |    2 +-
 src/Utils/Tests/SafeUriTests.cs |   10 +++++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/Utils/SafeUri.cs b/src/Utils/SafeUri.cs
index 880147f..6f381cc 100644
--- a/src/Utils/SafeUri.cs
+++ b/src/Utils/SafeUri.cs
@@ -39,7 +39,7 @@ namespace Hyena
             No
         }
 
-        private static int MAX_SCHEME_LENGTH = 6;
+        private static int MAX_SCHEME_LENGTH = 8;
 
         private string uri;
         private string local_path;
diff --git a/src/Utils/Tests/SafeUriTests.cs b/src/Utils/Tests/SafeUriTests.cs
index 90b7554..3fed58d 100644
--- a/src/Utils/Tests/SafeUriTests.cs
+++ b/src/Utils/Tests/SafeUriTests.cs
@@ -46,6 +46,14 @@ namespace FSpot.Utils.Tests
                 BaseUri = "file:///home/ruben/Projects/f-spot",
                 Filename = "README",
                 FilenameWithoutExtension = "README"
+            },
+            new SafeUriTest () {
+                Uri = "gphoto2://[usb:002,014]/",
+                AbsoluteUri = "gphoto2://[usb:002,014]/",
+                Extension = "",
+                BaseUri = "gphoto2://[usb:002,014]",
+                Filename = "",
+                FilenameWithoutExtension = ""
             }
         };
 
@@ -53,7 +61,7 @@ namespace FSpot.Utils.Tests
         public void TestFileUris ()
         {
             foreach (var test in tests) {
-                var suri = new SafeUri (test.Uri, test.IsURI);
+                var suri = new SafeUri (test.Uri);
                 Assert.AreEqual (suri.AbsoluteUri, test.AbsoluteUri, String.Format("AbsoluteUri for {0}", test.Uri));
                 Assert.AreEqual (suri.GetExtension (), test.Extension, String.Format("Extension for {0}", test.Uri));
                 Assert.AreEqual (suri.GetBaseUri ().ToString (), test.BaseUri, String.Format("BaseUri for {0}", test.Uri));



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