diff options
author | David Robillard <d@drobilla.net> | 2018-12-26 11:54:21 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-27 13:13:58 +0100 |
commit | 60bb4a81c03d6b0a08f9c858ff1a99bf3bcc602e (patch) | |
tree | 9905e430cf66ba4a8ffa4de9cc67e6d96ed878ad /tests | |
parent | c4e1eb61f7b8262030344712537c8918f4949a20 (diff) | |
download | serd-60bb4a81c03d6b0a08f9c858ff1a99bf3bcc602e.tar.gz serd-60bb4a81c03d6b0a08f9c858ff1a99bf3bcc602e.tar.bz2 serd-60bb4a81c03d6b0a08f9c858ff1a99bf3bcc602e.zip |
Add serd_new_boolean()
Diffstat (limited to 'tests')
-rw-r--r-- | tests/serd_test.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index 7a9e67bd..34463f7e 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -305,6 +305,22 @@ test_integer_to_node(void) } static void +test_boolean(void) +{ + SerdNode* true_node = serd_new_boolean(true); + assert(!strcmp(serd_node_string(true_node), "true")); + assert(!strcmp(serd_node_string(serd_node_datatype(true_node)), + NS_XSD "boolean")); + serd_node_free(true_node); + + SerdNode* false_node = serd_new_boolean(false); + assert(!strcmp(serd_node_string(false_node), "false")); + assert(!strcmp(serd_node_string(serd_node_datatype(false_node)), + NS_XSD "boolean")); + serd_node_free(false_node); +} + +static void test_blob_to_node(void) { assert(!serd_new_blob(NULL, 0, true, NULL)); @@ -773,6 +789,7 @@ main(void) test_double_to_node(); test_integer_to_node(); test_blob_to_node(); + test_boolean(); test_strlen(); test_strerror(); test_uri_parsing(); |