CTS Memory tests fix invalid allocation sizes
authorTony Zlatinski <tzlatinski@nvidia.com>
Sun, 24 Jan 2016 20:50:51 +0000 (14:50 -0600)
committerTony Zlatinski <tzlatinski@nvidia.com>
Mon, 25 Jan 2016 01:41:43 +0000 (19:41 -0600)
commitde3b298e13a63994f68fb073a577b95412ef4960
tree7d550b5252cba337150d0af55066072254c4f2f4
parent8a26c94351d0fda7e945c086cdc110b2890433cc
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.
external/vulkancts/modules/vulkan/memory/vktMemoryAllocationTests.cpp
external/vulkancts/modules/vulkan/memory/vktMemoryMappingTests.cpp