Merge branch 'tzlatinski_memory_allocaiton_size_fix' into 'master'
authorPyry Haulos <phaulos@google.com>
Tue, 26 Jan 2016 01:35:59 +0000 (20:35 -0500)
committerPyry Haulos <phaulos@google.com>
Tue, 26 Jan 2016 01:35:59 +0000 (20:35 -0500)
commit491ca7506be9decc1b9a1bc1facf0f8997fcb8c2
treef227dac26ec71a08854e23fbc8d9c3d451f820c0
parent2c4ea695fdabd82b31da7a2c9dbbf87e3c1c229a
parentde3b298e13a63994f68fb073a577b95412ef4960
Merge branch 'tzlatinski_memory_allocaiton_size_fix' into 'master'

CTS Memory tests fix invalid allocation sizes

allocateRandom() routine sometime requests enormous sizes
because of incorrect random size calculation logic.

Within the following formula:
m_heap.size / MAX_MEMORY_USAGE_DIV) - m_usage - 1ull
If m_heap.size / MAX_MEMORY_USAGE_DIV) - m_usage is "0"
the result is negative, but since the number is unsigned
max takes the max of 1 and the (unsigned long long)-1.

The change, makes the comparison signed and also introduces
explicit test checks on the allocation sizes.

See merge request !389