aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-05-12 17:56:27 +0200
committerDavid Robillard <d@drobilla.net>2018-12-30 17:58:17 -0500
commitf539637ea4dc40a8a2552f15092ea3abd69d5343 (patch)
tree8f28d1a53a41cc945f5c92bf879a59f16a4bb73f /tests
parent9c4bb09bd9fa42ca54c71e27f59e0cc81a528f37 (diff)
downloadserd-f539637ea4dc40a8a2552f15092ea3abd69d5343.tar.gz
serd-f539637ea4dc40a8a2552f15092ea3abd69d5343.tar.bz2
serd-f539637ea4dc40a8a2552f15092ea3abd69d5343.zip
Add serd_world_get_blank()
Diffstat (limited to 'tests')
-rw-r--r--tests/serd_test.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c
index e8d535a3..dbadb5bf 100644
--- a/tests/serd_test.c
+++ b/tests/serd_test.c
@@ -123,6 +123,23 @@ check_rel_uri(const char* uri,
return ret;
}
+static int
+test_get_blank(void)
+{
+ SerdWorld* world = serd_world_new();
+ char expected[8];
+
+ for (unsigned i = 0; i < 32; ++i) {
+ const SerdNode* blank = serd_world_get_blank(world);
+
+ snprintf(expected, sizeof(expected), "b%u", i + 1);
+ assert(!strcmp(serd_node_get_string(blank), expected));
+ }
+
+ serd_world_free(world);
+ return 0;
+}
+
int
main(void)
{
@@ -379,6 +396,10 @@ main(void)
SerdWorld* world = serd_world_new();
+ if (test_get_blank()) {
+ return 1;
+ }
+
SerdNode* u = serd_node_new_uri("http://example.org/foo");
SerdNode* b = serd_node_new_curie("invalid");
SerdNode* c = serd_node_new_curie("eg.2:b");