aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_uri.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-12-19 17:55:02 -0500
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commit0f9816d67bc67a396607291f845ca2a33c2285a7 (patch)
treeb31fd1b344305dc984a2109084fa183573a0ae43 /test/test_uri.c
parent258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d (diff)
downloadserd-0f9816d67bc67a396607291f845ca2a33c2285a7.tar.gz
serd-0f9816d67bc67a396607291f845ca2a33c2285a7.tar.bz2
serd-0f9816d67bc67a396607291f845ca2a33c2285a7.zip
Use ZixAllocator directly
Diffstat (limited to 'test/test_uri.c')
-rw-r--r--test/test_uri.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/test_uri.c b/test/test_uri.c
index bf4fa0f3..9c832bc1 100644
--- a/test/test_uri.c
+++ b/test/test_uri.c
@@ -5,10 +5,10 @@
#include "failing_allocator.h"
-#include "serd/memory.h"
#include "serd/node.h"
#include "serd/nodes.h"
#include "serd/uri.h"
+#include "zix/allocator.h"
#include "zix/string_view.h"
#include <assert.h>
@@ -29,8 +29,8 @@ test_file_uri_failed_alloc(void)
assert(!strcmp(path, "/path/spacey dir/100%.ttl"));
assert(!strcmp(hostname, "host"));
- serd_free(&allocator.base, path);
- serd_free(&allocator.base, hostname);
+ zix_free(&allocator.base, path);
+ zix_free(&allocator.base, hostname);
// Test that each allocation failing is handled gracefully
const size_t n_allocs = allocator.n_allocations;
@@ -40,8 +40,8 @@ test_file_uri_failed_alloc(void)
path = serd_parse_file_uri(&allocator.base, string, &hostname);
assert(!path || !hostname);
- serd_free(&allocator.base, path);
- serd_free(&allocator.base, hostname);
+ zix_free(&allocator.base, path);
+ zix_free(&allocator.base, hostname);
}
}
@@ -90,8 +90,8 @@ test_file_uri(const char* const hostname,
assert(!hostname || !strcmp(hostname, out_hostname));
assert(!strcmp(out_path, expected_path));
- serd_free(NULL, out_path);
- serd_free(NULL, out_hostname);
+ zix_free(NULL, out_path);
+ zix_free(NULL, out_hostname);
serd_nodes_free(nodes);
}
@@ -148,17 +148,17 @@ test_uri_parsing(void)
// Check that NULL hostname doesn't crash
char* out_path = serd_parse_file_uri(NULL, "file://me/path", NULL);
assert(!strcmp(out_path, "/path"));
- serd_free(NULL, out_path);
+ zix_free(NULL, out_path);
// Invalid first escape character
out_path = serd_parse_file_uri(NULL, "file:///foo/%0Xbar", NULL);
assert(!strcmp(out_path, "/foo/bar"));
- serd_free(NULL, out_path);
+ zix_free(NULL, out_path);
// Invalid second escape character
out_path = serd_parse_file_uri(NULL, "file:///foo/%X0bar", NULL);
assert(!strcmp(out_path, "/foo/bar"));
- serd_free(NULL, out_path);
+ zix_free(NULL, out_path);
}
static void