diff options
author | David Robillard <d@drobilla.net> | 2018-06-13 17:11:13 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-12-19 20:55:21 -0500 |
commit | 633d058cf776e28bb0ce0505e58b0be348674be4 (patch) | |
tree | c75719d5236fbdd032f0242167b5883980ec51e6 /tests/serd_test.c | |
parent | 6aabd3c6c7ef77009e7b9e5c8b01c3759730dc7a (diff) | |
download | serd-633d058cf776e28bb0ce0505e58b0be348674be4.tar.gz serd-633d058cf776e28bb0ce0505e58b0be348674be4.tar.bz2 serd-633d058cf776e28bb0ce0505e58b0be348674be4.zip |
Remove escape parameter from serd_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 'tests/serd_test.c')
-rw-r--r-- | tests/serd_test.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index e58380c4..caed7deb 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -82,7 +82,6 @@ test_sink(void* handle, static void test_file_uri(const char* hostname, const char* path, - bool escape, const char* expected_uri, const char* expected_path) { @@ -90,7 +89,7 @@ test_file_uri(const char* hostname, expected_path = path; } - SerdNode* node = serd_new_file_uri(path, hostname, escape); + SerdNode* node = serd_new_file_uri(path, hostname); const char* node_str = serd_node_get_string(node); char* out_hostname = NULL; char* out_path = serd_file_uri_parse(node_str, &out_hostname); @@ -332,17 +331,15 @@ test_strerror(void) static void test_uri_parsing(void) { - test_file_uri(NULL, "C:/My 100%", true, + test_file_uri(NULL, "C:/My 100%", "file:///C:/My%20100%%", NULL); - test_file_uri("ahost", "C:\\Pointless Space", true, + test_file_uri("ahost", "C:\\Pointless Space", "file://ahost/C:/Pointless%20Space", "C:/Pointless Space"); - test_file_uri(NULL, "/foo/bar", true, + test_file_uri(NULL, "/foo/bar", "file:///foo/bar", NULL); - test_file_uri("bhost", "/foo/bar", true, + test_file_uri("bhost", "/foo/bar", "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, + test_file_uri(NULL, "a/relative <path>", "a/relative%20%3Cpath%3E", NULL); // Test tolerance of parsing junk URI escapes |