util/tests: initialise key in cache_test
Fixes: e8495646af
("glsl/tests: changes to test_disk_cache_create test")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2631
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11623>
This commit is contained in:
parent
58a4ae3b99
commit
a917c7433a
|
@ -174,15 +174,16 @@ does_cache_contain(struct disk_cache *cache, const cache_key key)
|
|||
static bool
|
||||
cache_exists(struct disk_cache *cache)
|
||||
{
|
||||
uint8_t dummy_key[20];
|
||||
uint8_t key[20];
|
||||
char data[] = "some test data";
|
||||
|
||||
if (!cache)
|
||||
return NULL;
|
||||
|
||||
disk_cache_put(cache, dummy_key, data, sizeof(data), NULL);
|
||||
disk_cache_compute_key(cache, data, sizeof(data), key);
|
||||
disk_cache_put(cache, key, data, sizeof(data), NULL);
|
||||
disk_cache_wait_for_idle(cache);
|
||||
void *result = disk_cache_get(cache, dummy_key, NULL);
|
||||
void *result = disk_cache_get(cache, key, NULL);
|
||||
|
||||
free(result);
|
||||
return result != NULL;
|
||||
|
|
Loading…
Reference in New Issue