Changes in tests/check_util.c [7bee5af:2c7df62]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/check_util.c
r7bee5af r2c7df62 7 7 #include "set.h" 8 8 #include "misc.h" 9 #include "url.h"10 9 11 10 START_TEST(test_strip_linefeed) … … 44 43 END_TEST 45 44 46 START_TEST(test_set_url_http)47 url_t url;48 49 fail_if (0 == url_set(&url, "http://host/"));50 fail_unless (!strcmp(url.host, "host"));51 fail_unless (!strcmp(url.file, "/"));52 fail_unless (!strcmp(url.user, ""));53 fail_unless (!strcmp(url.pass, ""));54 fail_unless (url.proto == PROTO_HTTP);55 fail_unless (url.port == 80);56 END_TEST57 58 START_TEST(test_set_url_https)59 url_t url;60 61 fail_if (0 == url_set(&url, "https://ahost/AimeeMann"));62 fail_unless (!strcmp(url.host, "ahost"));63 fail_unless (!strcmp(url.file, "/AimeeMann"));64 fail_unless (!strcmp(url.user, ""));65 fail_unless (!strcmp(url.pass, ""));66 fail_unless (url.proto == PROTO_HTTPS);67 fail_unless (url.port == 443);68 END_TEST69 70 START_TEST(test_set_url_port)71 url_t url;72 73 fail_if (0 == url_set(&url, "https://ahost:200/Lost/In/Space"));74 fail_unless (!strcmp(url.host, "ahost"));75 fail_unless (!strcmp(url.file, "/Lost/In/Space"));76 fail_unless (!strcmp(url.user, ""));77 fail_unless (!strcmp(url.pass, ""));78 fail_unless (url.proto == PROTO_HTTPS);79 fail_unless (url.port == 200);80 END_TEST81 82 START_TEST(test_set_url_username)83 url_t url;84 85 fail_if (0 == url_set(&url, "socks4://user@ahost/Space"));86 fail_unless (!strcmp(url.host, "ahost"));87 fail_unless (!strcmp(url.file, "/Space"));88 fail_unless (!strcmp(url.user, "user"));89 fail_unless (!strcmp(url.pass, ""));90 fail_unless (url.proto == PROTO_SOCKS4);91 fail_unless (url.port == 1080);92 END_TEST93 94 START_TEST(test_set_url_username_pwd)95 url_t url;96 97 fail_if (0 == url_set(&url, "socks5://user:pass@ahost/"));98 fail_unless (!strcmp(url.host, "ahost"));99 fail_unless (!strcmp(url.file, "/"));100 fail_unless (!strcmp(url.user, "user"));101 fail_unless (!strcmp(url.pass, "pass"));102 fail_unless (url.proto == PROTO_SOCKS5);103 fail_unless (url.port == 1080);104 END_TEST105 106 45 Suite *util_suite (void) 107 46 { … … 111 50 tcase_add_test (tc_core, test_strip_linefeed); 112 51 tcase_add_test (tc_core, test_strip_newlines); 113 tcase_add_test (tc_core, test_set_url_http);114 tcase_add_test (tc_core, test_set_url_https);115 tcase_add_test (tc_core, test_set_url_port);116 tcase_add_test (tc_core, test_set_url_username);117 tcase_add_test (tc_core, test_set_url_username_pwd);118 52 return s; 119 53 }
Note: See TracChangeset
for help on using the changeset viewer.