Remove flawed alignment-related overflow test.

Remove the allocm() test equivalent to the mallocx() test removed in the
previous commit.  The flawed test attempted to cause OOM due to large
request size and alignment constraint.  Although this test "passed" on
64-bit systems due to the virtual memory hole, it could pass on some
32-bit systems.
This commit is contained in:
Jason Evans 2014-01-29 10:54:18 -08:00
parent 5f60afa01e
commit 2850e90d0d

View File

@ -39,28 +39,6 @@ TEST_BEGIN(test_basic)
}
TEST_END
TEST_BEGIN(test_alignment_errors)
{
void *p;
size_t nsz, rsz, sz, alignment;
#if LG_SIZEOF_PTR == 3
alignment = UINT64_C(0x4000000000000000);
sz = UINT64_C(0x8400000000000001);
#else
alignment = 0x40000000LU;
sz = 0x84000001LU;
#endif
nsz = 0;
assert_d_eq(nallocm(&nsz, sz, ALLOCM_ALIGN(alignment)), ALLOCM_SUCCESS,
"Unexpected nallocm() error");
rsz = 0;
assert_d_ne(allocm(&p, &rsz, sz, ALLOCM_ALIGN(alignment)),
ALLOCM_SUCCESS, "Expected error for allocm(&p, %zu, %#x)",
sz, ALLOCM_ALIGN(alignment));
}
TEST_END
TEST_BEGIN(test_alignment_and_size)
{
int r;
@ -126,6 +104,5 @@ main(void)
return (test(
test_basic,
test_alignment_errors,
test_alignment_and_size));
}