diff options
author | 2016-06-16 14:05:09 -0700 | |
---|---|---|
committer | 2016-06-16 14:05:09 -0700 | |
commit | 6dc3af4499893045f7b187d5d85bc785b6e44baa (patch) | |
tree | a039e1db7c94da1bc4629784c42f50395a9ede1f /tests | |
parent | b6095ae05bab1ca3b05c6eca091295cdc922d184 (diff) |
Check for some potential subheap allocation failures.
Need to make sure we can allocate areas larger than our specified
subheap sizes, and deal with potential fragmentation in the main
system heap.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2072763002
Review-Url: https://codereview.chromium.org/2072763002
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/VkHeapTests.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/VkHeapTests.cpp b/tests/VkHeapTests.cpp index 29990257a9..c4a9beb5f2 100755 --- a/tests/VkHeapTests.cpp +++ b/tests/VkHeapTests.cpp @@ -155,6 +155,11 @@ void suballoc_test(skiatest::Reporter* reporter, GrContext* context) { REPORTER_ASSERT(reporter, heap.allocSize() == 128 * 1024 && heap.usedSize() == 40 * 1024); heap.free(alloc3); REPORTER_ASSERT(reporter, heap.allocSize() == 128 * 1024 && heap.usedSize() == 0 * 1024); + // heap should not grow here (allocating more than subheap size) + REPORTER_ASSERT(reporter, heap.alloc(128 * 1024, kAlignment, kHeapIndex, &alloc0)); + REPORTER_ASSERT(reporter, 0 == alloc0.fSize); + REPORTER_ASSERT(reporter, heap.allocSize() == 128 * 1024 && heap.usedSize() == 0 * 1024); + heap.free(alloc0); } void singlealloc_test(skiatest::Reporter* reporter, GrContext* context) { |