aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_canon.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-08-30 20:43:05 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commit258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d (patch)
treed7be35c7b4b3d466049352f2975e2c88c298f4b8 /test/test_canon.c
parentb13ad41a4d65b577b4db67660a9edf3056bdf7af (diff)
downloadserd-258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d.tar.gz
serd-258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d.tar.bz2
serd-258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d.zip
Use ZixStringView directly
Diffstat (limited to 'test/test_canon.c')
-rw-r--r--test/test_canon.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/test/test_canon.c b/test/test_canon.c
index 89d1312b..ce3cfc67 100644
--- a/test/test_canon.c
+++ b/test/test_canon.c
@@ -11,8 +11,8 @@
#include "serd/nodes.h"
#include "serd/sink.h"
#include "serd/status.h"
-#include "serd/string_view.h"
#include "serd/world.h"
+#include "zix/string_view.h"
#include <assert.h>
#include <stddef.h>
@@ -56,11 +56,13 @@ test_new_failed_alloc(void)
static void
test_write_failed_alloc(void)
{
- const SerdStringView s_string = serd_string("http://example.org/s");
- const SerdStringView p_string = serd_string("http://example.org/p");
- const SerdStringView o_string = serd_string("012.340");
- const SerdStringView xsd_float =
- serd_string("http://www.w3.org/2001/XMLSchema#float");
+#define NS_EG "http://example.org/s"
+#define NS_XSD "http://www.w3.org/2001/XMLSchema#"
+
+ static const ZixStringView s_string = ZIX_STATIC_STRING(NS_EG "s");
+ static const ZixStringView p_string = ZIX_STATIC_STRING(NS_EG "p");
+ static const ZixStringView o_string = ZIX_STATIC_STRING("012.340");
+ static const ZixStringView xsd_float = ZIX_STATIC_STRING(NS_XSD "float");
SerdFailingAllocator allocator = serd_failing_allocator();
SerdWorld* const world = serd_world_new(&allocator.base);
@@ -92,6 +94,9 @@ test_write_failed_alloc(void)
serd_sink_free(target);
serd_nodes_free(nodes);
serd_world_free(world);
+
+#undef NS_XSD
+#undef NS_EG
}
int