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
This commit is contained in:
Enji Cooper 2016-08-25 19:17:16 +00:00
parent 74f4c1cf51
commit 1ffd722a80
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/netbsd-tests-update-12/; revision=304813

View File

@ -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);