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


Trivial merge