Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Unified Diff: tests/VkHeapTests.cpp

Issue 2072763002: Check for some potential subheap allocation failures. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add some asserts Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkMemory.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/VkHeapTests.cpp
diff --git a/tests/VkHeapTests.cpp b/tests/VkHeapTests.cpp
index 29990257a95f66b6a729cdfa170b204bc7d5eb3c..c4a9beb5f23d14248e188090fadccf2a23409ae7 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) {
« no previous file with comments | « src/gpu/vk/GrVkMemory.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698