diff options
author | David Robillard <d@drobilla.net> | 2018-06-13 17:11:13 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-04-13 19:15:32 +0200 |
commit | 1cfecadf30286bb146a9f60154dc9d4e48f8d1cb (patch) | |
tree | 1e450bcd0124f46136289e82d7adf866c6fd8fdc /tests | |
parent | 21ae5645e37837b3933140148ab7c382a834722d (diff) | |
download | serd-1cfecadf30286bb146a9f60154dc9d4e48f8d1cb.tar.gz serd-1cfecadf30286bb146a9f60154dc9d4e48f8d1cb.tar.bz2 serd-1cfecadf30286bb146a9f60154dc9d4e48f8d1cb.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')
-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 d4bb1e42..b8b35a0b 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -84,7 +84,6 @@ test_sink(void* handle, static int check_file_uri(const char* hostname, const char* path, - bool escape, const char* expected_uri, const char* expected_path) { @@ -92,7 +91,7 @@ check_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); @@ -260,18 +259,16 @@ main(void) // Test file URI escaping and parsing - if (check_file_uri(NULL, "C:/My 100%", true, + if (check_file_uri(NULL, "C:/My 100%", "file:///C:/My%20100%%", NULL) || - check_file_uri("ahost", "C:\\Pointless Space", true, + check_file_uri("ahost", "C:\\Pointless Space", "file://ahost/C:/Pointless%20Space", "C:/Pointless Space") || - check_file_uri(NULL, "/foo/bar", true, + check_file_uri(NULL, "/foo/bar", "file:///foo/bar", NULL) || - check_file_uri("bhost", "/foo/bar", true, + check_file_uri("bhost", "/foo/bar", "file://bhost/foo/bar", NULL) || - check_file_uri(NULL, "a/relative path", false, - "a/relative path", NULL) || - check_file_uri(NULL, "a/relative <path>", true, + check_file_uri(NULL, "a/relative <path>", "a/relative%20%3Cpath%3E", NULL)) { return 1; } |