summaryrefslogtreecommitdiffstats
path: root/src/vulkan/tests
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-09-15 21:37:01 -0700
committerJason Ekstrand <[email protected]>2015-09-17 17:44:20 -0700
commitdcf424c98cf32597e83cbc87eb5d62909a5bf481 (patch)
tree4f1f48ca12a21ee1b7b0fa80bdfd3a007851b733 /src/vulkan/tests
parent5f57ff7e18c1c545aafcdc267bc22594cef81d3c (diff)
anv/tests: Add some asserts for data integrity in block_pool_no_free
Diffstat (limited to 'src/vulkan/tests')
-rw-r--r--src/vulkan/tests/block_pool_no_free.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/vulkan/tests/block_pool_no_free.c b/src/vulkan/tests/block_pool_no_free.c
index 01c23e21b2d..86d1a76151f 100644
--- a/src/vulkan/tests/block_pool_no_free.c
+++ b/src/vulkan/tests/block_pool_no_free.c
@@ -41,10 +41,30 @@ struct job {
static void *alloc_blocks(void *_job)
{
struct job *job = _job;
+ int32_t block, *data;
for (unsigned i = 0; i < BLOCKS_PER_THREAD; i++) {
- job->blocks[i] = anv_block_pool_alloc(job->pool);
- job->back_blocks[i] = -anv_block_pool_alloc_back(job->pool);
+ block = anv_block_pool_alloc(job->pool);
+ data = job->pool->map + block;
+ *data = block;
+ assert(block >= 0);
+ job->blocks[i] = block;
+
+ block = anv_block_pool_alloc_back(job->pool);
+ data = job->pool->map + block;
+ *data = block;
+ assert(block < 0);
+ job->back_blocks[i] = -block;
+ }
+
+ for (unsigned i = 0; i < BLOCKS_PER_THREAD; i++) {
+ block = job->blocks[i];
+ data = job->pool->map + block;
+ assert(*data == block);
+
+ block = -job->back_blocks[i];
+ data = job->pool->map + block;
+ assert(*data == block);
}
return NULL;