aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-10-02 18:03:29 +0000
committerDavid Robillard <d@drobilla.net>2015-10-02 18:03:29 +0000
commitaec46529233290f8274d137b795b4924f1db131a (patch)
tree837bbb7a5cedb2ddaa5e73c51acb14a480cb2480 /tests
parentd908317e729ffc2495b9fc546cff88b541eacfb2 (diff)
downloadserd-aec46529233290f8274d137b795b4924f1db131a.tar.gz
serd-aec46529233290f8274d137b795b4924f1db131a.tar.bz2
serd-aec46529233290f8274d137b795b4924f1db131a.zip
Full test coverage
git-svn-id: http://svn.drobilla.net/serd/trunk@492 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'tests')
-rw-r--r--tests/serd_test.c14
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) {