aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_overflow.c14
-rw-r--r--test/test_read_chunk.c4
-rw-r--r--test/test_reader_writer.c14
3 files changed, 24 insertions, 8 deletions
diff --git a/test/test_overflow.c b/test/test_overflow.c
index 851c8289..8534e2c5 100644
--- a/test/test_overflow.c
+++ b/test/test_overflow.c
@@ -24,14 +24,20 @@
static SerdStatus
test(SerdWorld* world, SerdSink* sink, const char* str, size_t stack_size)
{
- SerdByteSource* byte_source = serd_byte_source_new_string(str, NULL);
-
- SerdReader* reader =
- serd_reader_new(world, SERD_TURTLE, SERD_READ_VARIABLES, sink, stack_size);
+ SerdByteSource* const byte_source = serd_byte_source_new_string(str, NULL);
+ SerdEnv* const env = serd_env_new(SERD_EMPTY_STRING());
+ SerdReader* const reader = serd_reader_new(
+ world,
+ SERD_TURTLE,
+ SERD_READ_VARIABLES | SERD_READ_PREFIXED | SERD_READ_RELATIVE,
+ env,
+ sink,
+ stack_size);
serd_reader_start(reader, byte_source);
const SerdStatus st = serd_reader_read_document(reader);
serd_reader_free(reader);
+ serd_env_free(env);
serd_byte_source_free(byte_source);
return st;
}
diff --git a/test/test_read_chunk.c b/test/test_read_chunk.c
index 1cb19aaf..1186f69e 100644
--- a/test/test_read_chunk.c
+++ b/test/test_read_chunk.c
@@ -106,7 +106,8 @@ main(void)
"eg:s4 eg:p1 [ eg:p3 eg:o1 ] .\n",
NULL);
- SerdReader* reader = serd_reader_new(world, SERD_TURTLE, 0, sink, 4096);
+ SerdEnv* env = serd_env_new(SERD_EMPTY_STRING());
+ SerdReader* reader = serd_reader_new(world, SERD_TURTLE, 0, env, sink, 4096);
assert(reader);
assert(!serd_reader_start(reader, byte_source));
@@ -123,6 +124,7 @@ main(void)
assert(!serd_reader_finish(reader));
serd_reader_free(reader);
+ serd_env_free(env);
serd_byte_source_free(byte_source);
serd_sink_free(sink);
serd_world_free(world);
diff --git a/test/test_reader_writer.c b/test/test_reader_writer.c
index 86c6b442..58ea1944 100644
--- a/test/test_reader_writer.c
+++ b/test/test_reader_writer.c
@@ -76,7 +76,9 @@ test_read_chunks(void)
SerdSink* const sink = serd_sink_new(&n_statements, count_statements, NULL);
assert(sink);
- SerdReader* const reader = serd_reader_new(world, SERD_TURTLE, 0, sink, 4096);
+ SerdEnv* const env = serd_env_new(SERD_EMPTY_STRING());
+ SerdReader* const reader =
+ serd_reader_new(world, SERD_TURTLE, 0, env, sink, 4096);
assert(reader);
SerdByteSource* byte_source = serd_byte_source_new_function(
@@ -124,6 +126,7 @@ test_read_chunks(void)
assert(n_statements == 2);
serd_reader_free(reader);
+ serd_env_free(env);
serd_byte_source_free(byte_source);
serd_sink_free(sink);
fclose(f);
@@ -196,7 +199,9 @@ test_read_string(void)
SerdSink* const sink = serd_sink_new(&n_statements, count_statements, NULL);
assert(sink);
- SerdReader* const reader = serd_reader_new(world, SERD_TURTLE, 0, sink, 4096);
+ SerdEnv* const env = serd_env_new(SERD_EMPTY_STRING());
+ SerdReader* const reader =
+ serd_reader_new(world, SERD_TURTLE, 0, env, sink, 4096);
assert(reader);
SerdByteSource* byte_source =
@@ -212,6 +217,7 @@ test_read_string(void)
assert(!serd_reader_finish(reader));
serd_reader_free(reader);
+ serd_env_free(env);
serd_byte_source_free(byte_source);
serd_sink_free(sink);
serd_world_free(world);
@@ -335,7 +341,8 @@ test_reader(const char* path)
SerdSink* const sink = serd_sink_new(&n_statements, count_statements, NULL);
assert(sink);
- SerdReader* reader = serd_reader_new(world, SERD_TURTLE, 0, sink, 4096);
+ SerdEnv* const env = serd_env_new(SERD_EMPTY_STRING());
+ SerdReader* reader = serd_reader_new(world, SERD_TURTLE, 0, env, sink, 4096);
assert(reader);
assert(serd_reader_read_document(reader) == SERD_ERR_BAD_CALL);
@@ -401,6 +408,7 @@ test_reader(const char* path)
}
serd_reader_free(reader);
+ serd_env_free(env);
serd_sink_free(sink);
serd_world_free(world);
}