Optimize the code that copies strings
[fio.git] / unittests / lib / memalign.c
CommitLineData
e37155ef
TK
1#include "../unittest.h"
2
3#include "../../lib/memalign.h"
4
5static void test_memalign_1(void)
6{
7 size_t align = 4096;
8 void *p = fio_memalign(align, 1234, false);
9
10 if (p)
11 CU_ASSERT_EQUAL(((int)(uintptr_t)p) & (align - 1), 0);
12}
13
14static struct fio_unittest_entry tests[] = {
15 {
16 .name = "memalign/1",
17 .fn = test_memalign_1,
18 },
19 {
20 .name = NULL,
21 },
22};
23
24CU_ErrorCode fio_unittest_lib_memalign(void)
25{
26 return fio_unittest_add_suite("lib/memalign.c", NULL, NULL, tests);
27}