summaryrefslogtreecommitdiff
path: root/test/helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/helpers.c')
-rw-r--r--test/helpers.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/helpers.c b/test/helpers.c
index a2b98db..ea705fb 100644
--- a/test/helpers.c
+++ b/test/helpers.c
@@ -15,7 +15,7 @@
/*
* Helper for allocating memory in tests.
*/
-void *io_uring_malloc(size_t size)
+void *t_malloc(size_t size)
{
void *ret;
ret = malloc(size);
@@ -26,7 +26,7 @@ void *io_uring_malloc(size_t size)
/*
* Helper for allocating size bytes aligned on a boundary.
*/
-void io_uring_posix_memalign(void **memptr, size_t alignment, size_t size)
+void t_posix_memalign(void **memptr, size_t alignment, size_t size)
{
int ret;
ret = posix_memalign(memptr, alignment, size);
@@ -37,7 +37,7 @@ void io_uring_posix_memalign(void **memptr, size_t alignment, size_t size)
* Helper for allocating space for an array of nmemb elements
* with size bytes for each element.
*/
-void *io_uring_calloc(size_t nmemb, size_t size)
+void *t_calloc(size_t nmemb, size_t size)
{
void *ret;
ret = calloc(nmemb, size);
@@ -48,13 +48,13 @@ void *io_uring_calloc(size_t nmemb, size_t size)
/*
* Helper for creating file and write @size byte buf with 0xaa value in the file.
*/
-void io_uring_create_file(const char *file, size_t size)
+void t_create_file(const char *file, size_t size)
{
ssize_t ret;
char *buf;
int fd;
- buf = io_uring_malloc(size);
+ buf = t_malloc(size);
memset(buf, 0xaa, size);
fd = open(file, O_WRONLY | O_CREAT, 0644);
@@ -71,14 +71,14 @@ void io_uring_create_file(const char *file, size_t size)
* Helper for creating @buf_num number of iovec
* with @buf_size bytes buffer of each iovec.
*/
-struct iovec *io_uring_create_buffers(size_t buf_num, size_t buf_size)
+struct iovec *t_create_buffers(size_t buf_num, size_t buf_size)
{
struct iovec *vecs;
int i;
- vecs = io_uring_malloc(buf_num * sizeof(struct iovec));
+ vecs = t_malloc(buf_num * sizeof(struct iovec));
for (i = 0; i < buf_num; i++) {
- io_uring_posix_memalign(&vecs[i].iov_base, buf_size, buf_size);
+ t_posix_memalign(&vecs[i].iov_base, buf_size, buf_size);
vecs[i].iov_len = buf_size;
}
return vecs;