aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_uri.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-06-13 17:11:13 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 16:27:02 -0500
commitb1d30dc791348eacd44ebd6a00d0cf166a9e1cf5 (patch)
tree64a77fc72ea86b30e3610dc6ffa26930bd4e1b85 /test/test_uri.c
parentd107eb486f24c0e68eff4e1b622850fca5f75d77 (diff)
downloadserd-b1d30dc791348eacd44ebd6a00d0cf166a9e1cf5.tar.gz
serd-b1d30dc791348eacd44ebd6a00d0cf166a9e1cf5.tar.bz2
serd-b1d30dc791348eacd44ebd6a00d0cf166a9e1cf5.zip
Remove escape parameter from serd_node_new_file_uri
Since characters are escaped because they are not valid characters in a URI, any use of this function without escaping is problematic at best.
Diffstat (limited to 'test/test_uri.c')
-rw-r--r--test/test_uri.c35
1 files changed, 10 insertions, 25 deletions
diff --git a/test/test_uri.c b/test/test_uri.c
index daa64240..2747d008 100644
--- a/test/test_uri.c
+++ b/test/test_uri.c
@@ -37,7 +37,6 @@ test_uri_string_has_scheme(void)
static void
test_file_uri(const char* const hostname,
const char* const path,
- const bool escape,
const char* const expected_uri,
const char* expected_path)
{
@@ -45,7 +44,7 @@ test_file_uri(const char* const hostname,
expected_path = path;
}
- SerdNode node = serd_node_new_file_uri(USTR(path), USTR(hostname), 0, escape);
+ SerdNode node = serd_node_new_file_uri(USTR(path), USTR(hostname), 0);
uint8_t* out_hostname = NULL;
uint8_t* out_path = serd_file_uri_parse(node.buf, &out_hostname);
@@ -62,32 +61,24 @@ test_file_uri(const char* const hostname,
static void
test_uri_parsing(void)
{
- test_file_uri(NULL, "C:/My 100%", true, "file:///C:/My%20100%%", NULL);
- test_file_uri(NULL, "/foo/bar", true, "file:///foo/bar", NULL);
- test_file_uri("bhost", "/foo/bar", true, "file://bhost/foo/bar", NULL);
- test_file_uri(NULL, "a/relative path", false, "a/relative path", NULL);
- test_file_uri(
- NULL, "a/relative <path>", true, "a/relative%20%3Cpath%3E", NULL);
+ test_file_uri(NULL, "C:/My 100%", "file:///C:/My%20100%%", NULL);
+ test_file_uri(NULL, "/foo/bar", "file:///foo/bar", NULL);
+ test_file_uri("bhost", "/foo/bar", "file://bhost/foo/bar", NULL);
+ test_file_uri(NULL, "a/relative <path>", "a/relative%20%3Cpath%3E", NULL);
#ifdef _WIN32
- test_file_uri(
- NULL, "C:\\My 100%", true, "file:///C:/My%20100%%", "C:/My 100%");
+ test_file_uri(NULL, "C:\\My 100%", "file:///C:/My%20100%%", "C:/My 100%");
- test_file_uri(NULL,
- "\\drive\\relative",
- true,
- "file:///drive/relative",
- "/drive/relative");
+ test_file_uri(
+ NULL, "\\drive\\relative", "file:///drive/relative", "/drive/relative");
test_file_uri(NULL,
"C:\\Program Files\\Serd",
- true,
"file:///C:/Program%20Files/Serd",
"C:/Program Files/Serd");
test_file_uri("ahost",
"C:\\Pointless Space",
- true,
"file://ahost/C:/Pointless%20Space",
"C:/Pointless Space");
#else
@@ -97,25 +88,19 @@ test_uri_parsing(void)
test_file_uri("ahost",
"C:\\Pointless Space",
- true,
"file://ahost/C:%5CPointless%20Space",
"/C:\\Pointless Space");
- test_file_uri(NULL,
- "\\drive\\relative",
- true,
- "%5Cdrive%5Crelative",
- "\\drive\\relative");
+ test_file_uri(
+ NULL, "\\drive\\relative", "%5Cdrive%5Crelative", "\\drive\\relative");
test_file_uri(NULL,
"C:\\Program Files\\Serd",
- true,
"file:///C:%5CProgram%20Files%5CSerd",
"/C:\\Program Files\\Serd");
test_file_uri("ahost",
"C:\\Pointless Space",
- true,
"file://ahost/C:%5CPointless%20Space",
"/C:\\Pointless Space");
#endif