diff options
author | Enji Cooper <ngie@FreeBSD.org> | 2016-08-25 19:17:16 +0000 |
---|---|---|
committer | Enji Cooper <ngie@FreeBSD.org> | 2016-08-25 19:17:16 +0000 |
commit | 1ffd722a80a9a6e14683da8b02db6ad6185cb5e9 (patch) | |
tree | 75e94cb42aa3a1ec2cbe2d25f1e051d09f8325e4 /contrib | |
parent | 74f4c1cf51a4c215a83e40e91b7104dcb087e5cc (diff) | |
download | src-1ffd722a80a9a6e14683da8b02db6ad6185cb5e9.tar.gz src-1ffd722a80a9a6e14683da8b02db6ad6185cb5e9.zip |
Don't test `size[i] % align[i] == 0` case on FreeBSD
Per jemalloc(3)/aligned_alloc(3), the behavior is undefined if the size
isn't an integral multiple of the alignment. Thus, this is a NetBSD-specific
test.
Sponsored by: EMC / Isilon Storage Division
Notes
Notes:
svn path=/projects/netbsd-tests-update-12/; revision=304813
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c b/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c index 697638e204e1..8db788075fc1 100644 --- a/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c +++ b/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c @@ -121,9 +121,19 @@ ATF_TC_BODY(aligned_alloc_basic, tc) ATF_REQUIRE_EQ_MSG((align[i] - 1) & align[i], 0, "aligned_alloc: success when alignment was not " "a power of 2"); +#ifdef __NetBSD__ + /* + * NetBSD-specific invariant + * + * From aligned_alloc(3) on FreeBSD: + * + * Behavior is undefined if size is not an integral + * multiple of alignment. + */ ATF_REQUIRE_EQ_MSG(size[i] % align[i], 0, "aligned_alloc: success when size was not an " "integer multiple of alignment"); +#endif ATF_REQUIRE_EQ_MSG(((intptr_t)p) & (align[i] - 1), 0, "p = %p", p); free(p); |