aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_reader_writer.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-05-12 17:56:27 +0200
committerDavid Robillard <d@drobilla.net>2021-03-08 23:23:05 -0500
commitf0f4bfb37f36fce6d6e216a90162b81691f61e83 (patch)
treec3038f393641334ba2c04bf82acc545f1038803f /test/test_reader_writer.c
parentfd276bcf70bad4520ca1d6f3c73f88073b3b58cf (diff)
downloadserd-f0f4bfb37f36fce6d6e216a90162b81691f61e83.tar.gz
serd-f0f4bfb37f36fce6d6e216a90162b81691f61e83.tar.bz2
serd-f0f4bfb37f36fce6d6e216a90162b81691f61e83.zip
Add serd_world_get_blank()
Diffstat (limited to 'test/test_reader_writer.c')
-rw-r--r--test/test_reader_writer.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_reader_writer.c b/test/test_reader_writer.c
index 48f20247..43b820db 100644
--- a/test/test_reader_writer.c
+++ b/test/test_reader_writer.c
@@ -140,6 +140,23 @@ test_read_chunks(void)
serd_world_free(world);
}
+static int
+test_get_blank(void)
+{
+ SerdWorld* world = serd_world_new();
+ char expected[12];
+
+ 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_string(blank), expected));
+ }
+
+ serd_world_free(world);
+ return 0;
+}
+
static void
test_read_string(void)
{
@@ -358,6 +375,7 @@ main(void)
{
test_read_chunks();
test_read_string();
+ test_get_blank();
const char* const path = "serd_test.ttl";
test_writer(path);