Mesa (main): util/tests: initialise key in cache_test

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 29 00:19:16 UTC 2021


Module: Mesa
Branch: main
Commit: a917c7433ac81f933c889f5c34b87b8802cce31b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a917c7433ac81f933c889f5c34b87b8802cce31b

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Mon Jun 28 20:31:46 2021 +1000

util/tests: initialise key in cache_test

Fixes: e8495646afb0 ("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 at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11623>

---

 src/util/tests/cache/cache_test.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/util/tests/cache/cache_test.c b/src/util/tests/cache/cache_test.c
index 144fd72173c..ec1587daaee 100644
--- a/src/util/tests/cache/cache_test.c
+++ b/src/util/tests/cache/cache_test.c
@@ -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;



More information about the mesa-commit mailing list