lib/memalign: remove smalloc()/sfree() dependency
[fio.git] / unittests / lib / memalign.c
CommitLineData
fd745bf3 1#include <stdlib.h>
e37155ef
TK
2#include "../unittest.h"
3
4#include "../../lib/memalign.h"
5
6static void test_memalign_1(void)
7{
8 size_t align = 4096;
fd745bf3 9 void *p = __fio_memalign(align, 1234, malloc);
e37155ef
TK
10
11 if (p)
12 CU_ASSERT_EQUAL(((int)(uintptr_t)p) & (align - 1), 0);
13}
14
15static struct fio_unittest_entry tests[] = {
16 {
17 .name = "memalign/1",
18 .fn = test_memalign_1,
19 },
20 {
21 .name = NULL,
22 },
23};
24
25CU_ErrorCode fio_unittest_lib_memalign(void)
26{
27 return fio_unittest_add_suite("lib/memalign.c", NULL, NULL, tests);
28}