diff options
Diffstat (limited to 'tests/serd_test.c')
-rw-r--r-- | tests/serd_test.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index eecbb5b0..39b5c14f 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -399,6 +399,11 @@ main(void) // Test serd_node_new_uri_from_string + SerdNode nonsense = serd_node_new_uri_from_string(NULL, NULL, NULL); + if (nonsense.type != SERD_NOTHING) { + return failure("Successfully created NULL URI\n"); + } + SerdURI base_uri; SerdNode base = serd_node_new_uri_from_string(USTR("http://example.org/"), NULL, &base_uri); @@ -420,6 +425,10 @@ main(void) SerdEnv* env = serd_env_new(NULL); serd_env_set_prefix_from_strings(env, USTR("eg.2"), USTR("http://example.org/")); + if (!serd_env_set_base_uri(env, NULL)) { + return failure("Successfully set NULL base URI\n"); + } + if (!serd_env_set_base_uri(env, &node)) { return failure("Set base URI to %s\n", node.buf); } @@ -614,7 +623,10 @@ main(void) return failure("Apparently read an http URI\n"); } if (!serd_reader_read_file(reader, USTR("file:///better/not/exist"))) { - return failure("Apprently read a non-existent file\n"); + return failure("Apparently read a non-existent file\n"); + } + if (!serd_reader_read_file(reader, USTR("file://"))) { + return failure("Apparently read a file with no path\n"); } SerdStatus st = serd_reader_read_file(reader, USTR(path)); if (st) { |