diff options
author | David Robillard <d@drobilla.net> | 2018-05-12 17:56:27 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-04-13 19:15:32 +0200 |
commit | e805c03be2bd1e9cee0ba5ce2c3f36f6fd913101 (patch) | |
tree | f44c37624181c7057443b3be5a96d36d7e7fcbed /tests | |
parent | 75e8cb67f5082abdffd8941a5255be9a22dd9cb7 (diff) | |
download | serd-e805c03be2bd1e9cee0ba5ce2c3f36f6fd913101.tar.gz serd-e805c03be2bd1e9cee0ba5ce2c3f36f6fd913101.tar.bz2 serd-e805c03be2bd1e9cee0ba5ce2c3f36f6fd913101.zip |
Add serd_world_get_blank()
Diffstat (limited to 'tests')
-rw-r--r-- | tests/serd_test.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index d45fda5d..c1bbd5da 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"); |