aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_writer.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_writer.c')
-rw-r--r--test/test_writer.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/test/test_writer.c b/test/test_writer.c
index 60f50308..17790527 100644
--- a/test/test_writer.c
+++ b/test/test_writer.c
@@ -15,10 +15,10 @@
#include "serd/sink.h"
#include "serd/statement.h"
#include "serd/status.h"
-#include "serd/string_view.h"
#include "serd/syntax.h"
#include "serd/world.h"
#include "serd/writer.h"
+#include "zix/string_view.h"
#include <assert.h>
#include <stdint.h>
@@ -30,7 +30,7 @@ static void
test_writer_new(void)
{
SerdWorld* world = serd_world_new(NULL);
- SerdEnv* env = serd_env_new(NULL, serd_empty_string());
+ SerdEnv* env = serd_env_new(NULL, zix_empty_string());
SerdBuffer buffer = {NULL, NULL, 0};
SerdOutputStream output = serd_open_output_buffer(&buffer);
@@ -46,7 +46,7 @@ test_new_failed_alloc(void)
SerdFailingAllocator allocator = serd_failing_allocator();
SerdWorld* const world = serd_world_new(&allocator.base);
- SerdEnv* env = serd_env_new(&allocator.base, serd_empty_string());
+ SerdEnv* env = serd_env_new(&allocator.base, zix_empty_string());
SerdBuffer buffer = {&allocator.base, NULL, 0};
SerdOutputStream output = serd_open_output_buffer(&buffer);
const size_t n_world_allocs = allocator.n_allocations;
@@ -76,7 +76,7 @@ test_write_failed_alloc(void)
SerdWorld* world = serd_world_new(&allocator.base);
SerdNodes* nodes = serd_world_nodes(world);
- SerdEnv* env = serd_env_new(NULL, serd_empty_string());
+ SerdEnv* env = serd_env_new(NULL, zix_empty_string());
SerdBuffer buffer = {&allocator.base, NULL, 0};
SerdOutputStream output = serd_open_output_buffer(&buffer);
@@ -135,7 +135,7 @@ static void
test_write_bad_event(void)
{
SerdWorld* world = serd_world_new(NULL);
- SerdEnv* env = serd_env_new(NULL, serd_empty_string());
+ SerdEnv* env = serd_env_new(NULL, zix_empty_string());
SerdBuffer buffer = {NULL, NULL, 0};
SerdOutputStream output = serd_open_output_buffer(&buffer);
@@ -164,7 +164,7 @@ test_write_long_literal(void)
{
SerdWorld* world = serd_world_new(NULL);
SerdNodes* nodes = serd_world_nodes(world);
- SerdEnv* env = serd_env_new(NULL, serd_empty_string());
+ SerdEnv* env = serd_env_new(NULL, zix_empty_string());
SerdBuffer buffer = {NULL, NULL, 0};
SerdOutputStream output = serd_open_output_buffer(&buffer);
@@ -180,9 +180,9 @@ test_write_long_literal(void)
const SerdNode* o =
serd_nodes_get(nodes,
- serd_a_literal(serd_string("hello \"\"\"world\"\"\"!"),
+ serd_a_literal(zix_string("hello \"\"\"world\"\"\"!"),
SERD_IS_LONG,
- serd_empty_string()));
+ zix_empty_string()));
assert(serd_node_flags(o) & SERD_IS_LONG);
assert(!serd_sink_write(serd_writer_sink(writer), 0, s, p, o, NULL));
@@ -222,7 +222,7 @@ test_writer_cleanup(void)
SerdStatus st = SERD_SUCCESS;
SerdWorld* world = serd_world_new(NULL);
SerdNodes* nodes = serd_world_nodes(world);
- SerdEnv* env = serd_env_new(NULL, serd_empty_string());
+ SerdEnv* env = serd_env_new(NULL, zix_empty_string());
SerdOutputStream output =
serd_open_output_stream(null_sink, NULL, NULL, NULL);
@@ -237,7 +237,7 @@ test_writer_cleanup(void)
const SerdNode* const p =
serd_nodes_get(nodes, serd_a_uri_string("http://example.org/p"));
- const SerdNode* o = serd_nodes_get(nodes, serd_a_blank(serd_string("start")));
+ const SerdNode* o = serd_nodes_get(nodes, serd_a_blank(zix_string("start")));
st = serd_sink_write(sink, SERD_ANON_O, s, p, o, NULL);
assert(!st);
@@ -275,7 +275,7 @@ test_strict_write(void)
SerdWorld* world = serd_world_new(NULL);
SerdNodes* nodes = serd_world_nodes(world);
- SerdEnv* const env = serd_env_new(NULL, serd_empty_string());
+ SerdEnv* const env = serd_env_new(NULL, zix_empty_string());
SerdOutputStream out = serd_open_output_stream(null_sink, NULL, NULL, fd);
SerdWriter* const writer =
serd_writer_new(world, SERD_TURTLE, 0U, env, &out, 1U);
@@ -328,7 +328,7 @@ test_write_error(void)
{
SerdWorld* const world = serd_world_new(NULL);
SerdNodes* const nodes = serd_world_nodes(world);
- SerdEnv* const env = serd_env_new(NULL, serd_empty_string());
+ SerdEnv* const env = serd_env_new(NULL, zix_empty_string());
SerdOutputStream out = serd_open_output_stream(error_sink, NULL, NULL, NULL);
SerdStatus st = SERD_SUCCESS;
@@ -352,9 +352,10 @@ test_write_error(void)
static void
test_writer_stack_overflow(void)
{
- SerdWorld* world = serd_world_new(NULL);
- SerdNodes* nodes = serd_world_nodes(world);
- SerdEnv* env = serd_env_new(NULL, serd_empty_string());
+ SerdWorld* world = serd_world_new(NULL);
+ SerdNodes* nodes = serd_world_nodes(world);
+ SerdEnv* env = serd_env_new(NULL, zix_empty_string());
+
SerdOutputStream output =
serd_open_output_stream(null_sink, NULL, NULL, NULL);
@@ -403,7 +404,7 @@ test_write_empty_syntax(void)
{
SerdWorld* world = serd_world_new(NULL);
SerdNodes* nodes = serd_world_nodes(world);
- SerdEnv* env = serd_env_new(NULL, serd_empty_string());
+ SerdEnv* env = serd_env_new(NULL, zix_empty_string());
const SerdNode* s =
serd_nodes_get(nodes, serd_a_uri_string("http://example.org/s"));
@@ -441,7 +442,7 @@ check_pname_escape(const char* const lname, const char* const expected)
{
SerdWorld* world = serd_world_new(NULL);
SerdNodes* nodes = serd_world_nodes(world);
- SerdEnv* env = serd_env_new(NULL, serd_empty_string());
+ SerdEnv* env = serd_env_new(NULL, zix_empty_string());
SerdBuffer buffer = {NULL, NULL, 0};
SerdOutputStream output = serd_open_output_buffer(&buffer);
@@ -452,7 +453,7 @@ check_pname_escape(const char* const lname, const char* const expected)
static const char* const prefix = "http://example.org/";
const size_t prefix_len = strlen(prefix);
- serd_env_set_prefix(env, serd_string("eg"), serd_string(prefix));
+ serd_env_set_prefix(env, zix_string("eg"), zix_string(prefix));
const SerdNode* s =
serd_nodes_get(nodes, serd_a_uri_string("http://example.org/s"));
@@ -517,7 +518,7 @@ test_write_bad_uri(void)
{
SerdWorld* world = serd_world_new(NULL);
SerdNodes* nodes = serd_world_nodes(world);
- SerdEnv* env = serd_env_new(NULL, serd_empty_string());
+ SerdEnv* env = serd_env_new(NULL, zix_empty_string());
const SerdNode* s =
serd_nodes_get(nodes, serd_a_uri_string("http://example.org/s"));