diff options
author | David Robillard <d@drobilla.net> | 2018-05-12 17:56:27 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-27 13:13:58 +0100 |
commit | 8b20b3e3bfd186b7b0bbd082a979c7fb86a52479 (patch) | |
tree | a4a8d9722f751ad8dab1e7c021b86f106d33dee6 /tests | |
parent | 40c90e819d20d6933504ccb639896be223e10c3c (diff) | |
download | serd-8b20b3e3bfd186b7b0bbd082a979c7fb86a52479.tar.gz serd-8b20b3e3bfd186b7b0bbd082a979c7fb86a52479.tar.bz2 serd-8b20b3e3bfd186b7b0bbd082a979c7fb86a52479.zip |
Add serd_world_get_blank()
Diffstat (limited to 'tests')
-rw-r--r-- | tests/serd_test.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index 0a65fbe9..168c4ee8 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -188,6 +188,23 @@ test_read_chunks(void) serd_world_free(world); } +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_string(blank), expected)); + } + + serd_world_free(world); + return 0; +} + static void test_read_string(void) { @@ -742,6 +759,7 @@ main(void) test_blank(); test_read_chunks(); test_read_string(); + test_get_blank(); const char* const path = "serd_test.ttl"; test_writer(path); |