From 90496cfc9bcf4e95279b65ffb06ae7df97d0104f Mon Sep 17 00:00:00 2001 From: Marcin Kazmierczak Date: Thu, 22 Dec 2011 10:52:34 +0100 Subject: [PATCH] tests: Extend rygel-http-item-uri-test.vala New test case with incorrect url. --- tests/rygel-http-item-uri-test.vala | 11 +++++++++++ 1 file changed, 11 insertions(+) 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); -- 2.7.4