diff options
author | David Robillard <d@drobilla.net> | 2018-12-26 11:54:21 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-13 23:03:43 -0500 |
commit | 2ddf10fb8bfabff3ecdbe9ea866a905631ec2866 (patch) | |
tree | 112a6068678ec9696d1ede59db0e461d920ca4ab /test | |
parent | c90c662f85ca1a36794a0404b2101a72de020ca3 (diff) | |
download | serd-2ddf10fb8bfabff3ecdbe9ea866a905631ec2866.tar.gz serd-2ddf10fb8bfabff3ecdbe9ea866a905631ec2866.tar.bz2 serd-2ddf10fb8bfabff3ecdbe9ea866a905631ec2866.zip |
Add serd_new_boolean()
Diffstat (limited to 'test')
-rw-r--r-- | test/test_node.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/test_node.c b/test/test_node.c index 968d4ada..f286aa16 100644 --- a/test/test_node.c +++ b/test/test_node.c @@ -21,6 +21,7 @@ #include <assert.h> #include <float.h> #include <math.h> +#include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> @@ -118,6 +119,26 @@ test_integer_to_node(void) } static void +test_boolean(void) +{ + SerdNode* const true_node = serd_new_boolean(true); + assert(!strcmp(serd_node_string(true_node), "true")); + + const SerdNode* const true_datatype = serd_node_datatype(true_node); + assert(true_datatype); + assert(!strcmp(serd_node_string(true_datatype), NS_XSD "boolean")); + serd_node_free(true_node); + + SerdNode* const false_node = serd_new_boolean(false); + assert(!strcmp(serd_node_string(false_node), "false")); + + const SerdNode* const false_datatype = serd_node_datatype(false_node); + assert(false_datatype); + assert(!strcmp(serd_node_string(false_datatype), NS_XSD "boolean")); + serd_node_free(false_node); +} + +static void test_blob_to_node(void) { assert(!serd_new_base64(&SERD_URI_NULL, 0, NULL)); @@ -302,6 +323,7 @@ main(void) test_new_decimal(); test_integer_to_node(); test_blob_to_node(); + test_boolean(); test_node_equals(); test_node_from_string(); test_node_from_substring(); |