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:
parent
74f4c1cf51
commit
1ffd722a80
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user