diff options
author | Marcin Kazmierczak <marcin.kazmierczak@comarch.com> | 2011-12-22 10:52:34 +0100 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2011-12-22 12:24:28 +0100 |
commit | 90496cfc9bcf4e95279b65ffb06ae7df97d0104f (patch) | |
tree | 7bc5aaf3ab1069d95a5d24538d2fba1932c97d78 /tests/rygel-http-item-uri-test.vala | |
parent | 2c80d54373a943479ac735e9884f909feff5b38b (diff) | |
download | rygel-90496cfc9bcf4e95279b65ffb06ae7df97d0104f.tar.gz |
tests: Extend rygel-http-item-uri-test.vala
New test case with incorrect url.
Diffstat (limited to 'tests/rygel-http-item-uri-test.vala')
-rw-r--r-- | 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 6c86ddb0..f79295a3 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); |