From 258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 30 Aug 2023 20:43:05 -0400 Subject: Use ZixStringView directly --- test/test_canon.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'test/test_canon.c') 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 #include @@ -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 -- cgit v1.2.1