[rygel] tests: Extend rygel-http-item-uri-test.vala



commit 90496cfc9bcf4e95279b65ffb06ae7df97d0104f
Author: Marcin Kazmierczak <marcin kazmierczak comarch com>
Date:   Thu Dec 22 10:52:34 2011 +0100

    tests: Extend rygel-http-item-uri-test.vala
    
    New test case with incorrect url.

 tests/rygel-http-item-uri-test.vala |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/tests/rygel-http-item-uri-test.vala b/tests/rygel-http-item-uri-test.vala
index 6c86ddb..f79295a 100644
--- a/tests/rygel-http-item-uri-test.vala
+++ b/tests/rygel-http-item-uri-test.vala
@@ -88,6 +88,7 @@ private class Rygel.HTTPItemURITest : GLib.Object {
             var str = this.test_to_string (uri);
             this.test_construction_from_string (str);
         }
+        this.test_error_construction ("/Ttt", Soup.KnownStatusCode.BAD_REQUEST);
     }
 
     private HTTPItemURITest () throws TestError {
@@ -140,6 +141,16 @@ private class Rygel.HTTPItemURITest : GLib.Object {
         return uri;
     }
 
+    private void test_error_construction (string str,
+                                          Soup.KnownStatusCode error_code) {
+        try {
+            var uri = new HTTPItemURI.from_string (str, this.server);
+            assert (uri == null);
+        } catch (HTTPRequestError error) {
+            assert (error.code == error_code);
+        }
+    }
+
     private string test_to_string (HTTPItemURI uri) {
         var str = uri.to_string ();
         assert (str != null);



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