aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_log.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-09-10 15:06:42 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commit248a874d7425749d29cf900a1c3783c624ea8d8c (patch)
treeaed59f5a484a815cd254506866e98a947858904d /test/test_log.c
parent0bd10132c6707353dba80bd89cf0102ee7ca4e34 (diff)
downloadserd-248a874d7425749d29cf900a1c3783c624ea8d8c.tar.gz
serd-248a874d7425749d29cf900a1c3783c624ea8d8c.tar.bz2
serd-248a874d7425749d29cf900a1c3783c624ea8d8c.zip
Add support for custom allocators
This makes it explicit in the API where memory is allocated, and allows the user to provide a custom allocator to avoid the use of the default system allocator for whatever reason.
Diffstat (limited to 'test/test_log.c')
-rw-r--r--test/test_log.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/test_log.c b/test/test_log.c
index 3ab2008f..5da8ec09 100644
--- a/test/test_log.c
+++ b/test/test_log.c
@@ -39,7 +39,7 @@ custom_log_func(void* const handle,
static void
test_bad_arg(void)
{
- SerdWorld* const world = serd_world_new();
+ SerdWorld* const world = serd_world_new(NULL);
bool called = false;
serd_set_log_func(world, custom_log_func, &called);
@@ -52,7 +52,7 @@ test_bad_arg(void)
static void
test_default_log(void)
{
- SerdWorld* const world = serd_world_new();
+ SerdWorld* const world = serd_world_new(NULL);
for (unsigned i = 0; i <= SERD_LOG_LEVEL_DEBUG; ++i) {
const SerdLogLevel level = (SerdLogLevel)i;
@@ -66,7 +66,7 @@ test_default_log(void)
static void
test_custom_log(void)
{
- SerdWorld* const world = serd_world_new();
+ SerdWorld* const world = serd_world_new(NULL);
bool called = false;
serd_set_log_func(world, custom_log_func, &called);
@@ -82,22 +82,22 @@ test_custom_log(void)
static void
test_caret(void)
{
- SerdWorld* const world = serd_world_new();
- SerdNode* const name = serd_new_string(serd_string("filename"));
- SerdCaret* const caret = serd_caret_new(name, 46, 2);
+ SerdWorld* const world = serd_world_new(NULL);
+ SerdNode* const name = serd_new_string(NULL, serd_string("filename"));
+ SerdCaret* const caret = serd_caret_new(NULL, name, 46, 2);
serd_logf_at(world, SERD_LOG_LEVEL_NOTICE, caret, "is just ahead of me");
serd_logf_at(world, SERD_LOG_LEVEL_NOTICE, NULL, "isn't");
- serd_caret_free(caret);
- serd_node_free(name);
+ serd_caret_free(NULL, caret);
+ serd_node_free(NULL, name);
serd_world_free(world);
}
static void
test_filename_only(void)
{
- SerdWorld* const world = serd_world_new();
+ SerdWorld* const world = serd_world_new(NULL);
const SerdLogField fields[3] = {{"TEST_KEY", "TEST VALUE"},
{"SERD_FILE", "somename"},