aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_overflow.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-12-02 17:11:23 -0500
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commitb13ad41a4d65b577b4db67660a9edf3056bdf7af (patch)
treee89535f6098a1b860f38ec8a7a1b698b30a72545 /test/test_overflow.c
parent0db18e483f11ac2f9518d96e137d217040ed1339 (diff)
downloadserd-b13ad41a4d65b577b4db67660a9edf3056bdf7af.tar.gz
serd-b13ad41a4d65b577b4db67660a9edf3056bdf7af.tar.bz2
serd-b13ad41a4d65b577b4db67660a9edf3056bdf7af.zip
Use SerdNodes instead of manual memory management in tests
Diffstat (limited to 'test/test_overflow.c')
-rw-r--r--test/test_overflow.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/test_overflow.c b/test/test_overflow.c
index edabd4eb..abc7d989 100644
--- a/test/test_overflow.c
+++ b/test/test_overflow.c
@@ -22,14 +22,16 @@ test_size(SerdWorld* const world,
limits.reader_stack_size = stack_size;
serd_world_set_limits(world, limits);
- SerdSink* sink = serd_sink_new(NULL, NULL, NULL, NULL);
- SerdEnv* const env = serd_env_new(NULL, serd_empty_string());
- SerdReader* const reader = serd_reader_new(world, syntax, flags, env, sink);
+ SerdNodes* const nodes = serd_world_nodes(world);
+ SerdAllocator* const alloc = serd_world_allocator(world);
+ SerdSink* sink = serd_sink_new(alloc, NULL, NULL, NULL);
+ SerdEnv* const env = serd_env_new(alloc, serd_empty_string());
+ SerdReader* const reader = serd_reader_new(world, syntax, flags, env, sink);
if (!reader) {
return SERD_BAD_STACK;
}
- SerdNode* string_name = serd_node_new(NULL, serd_a_string("string"));
+ const SerdNode* string_name = serd_nodes_get(nodes, serd_a_string("string"));
const char* position = str;
SerdInputStream in = serd_open_input_string(&position);
serd_reader_start(reader, &in, string_name, 1);
@@ -37,7 +39,6 @@ test_size(SerdWorld* const world,
const SerdStatus st = serd_reader_read_document(reader);
serd_close_input(&in);
- serd_node_free(NULL, string_name);
serd_reader_free(reader);
serd_env_free(env);
serd_sink_free(sink);