38 #define CATEGORY "/main/uri/" 41 {
"http://name:pass@localhost",
"http",
"name:pass",
"localhost",
NULL,
NULL, NULL},
42 {
"http://localhost",
"http",
NULL,
"localhost",
NULL,
NULL, NULL},
43 {
"http://localhost:80",
"http",
NULL,
"localhost",
"80",
NULL, NULL},
44 {
"http://localhost/path/",
"http",
NULL,
"localhost",
NULL,
"path/", NULL},
45 {
"http://localhost/?query",
"http",
NULL,
"localhost",
NULL,
"",
"query"},
46 {
"http://localhost:80/path",
"http",
NULL,
"localhost",
"80",
"path", NULL},
47 {
"http://localhost:80/?query",
"http",
NULL,
"localhost",
"80",
"",
"query"},
48 {
"http://localhost:80/path?query",
"http",
NULL,
"localhost",
"80",
"path",
"query"},
53 #define VALIDATE(value, expected_value) \ 54 do { ast_test_validate(test, \ 55 (value == expected_value) || \ 56 (value && expected_value && \ 57 !strcmp(value, expected_value))); \ 64 info->name = __func__;
66 info->summary =
"Uri parsing scenarios";
67 info->description =
"For each scenario validate result(s)";
94 info->name = __func__;
96 info->summary =
"parse an http uri with host only";
118 info->name = __func__;
120 info->summary =
"parse an https uri with host only";
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
static int load_module(void)
const char * ast_uri_path(const struct ast_uri *uri)
Retrieve the uri path.
Stores parsed uri information.
#define AST_TEST_REGISTER(cb)
struct ast_uri * ast_uri_parse(const char *uri)
Parse the given uri into a structure.
AST_TEST_DEFINE(uri_parse)
#define VALIDATE(value, expected_value)
const char * ast_uri_query(const struct ast_uri *uri)
Retrieve the uri query parameters.
const char * ast_uri_user_info(const struct ast_uri *uri)
Retrieve the uri user information.
struct ast_uri * ast_uri_parse_http(const char *uri)
Parse the given http uri into a structure.
int attribute_pure ast_uri_is_secure(const struct ast_uri *uri)
Retrieve if the uri is of a secure type.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
static int unload_module(void)
#define AST_TEST_UNREGISTER(cb)
const char * ast_uri_port(const struct ast_uri *uri)
Retrieve the uri port.
static const char * scenarios[][7]
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
const char * ast_uri_scheme(const struct ast_uri *uri)
Retrieve the uri scheme.
const char * ast_uri_host(const struct ast_uri *uri)
Retrieve the uri host.