anv/tests: Create a dummy instance as well as device
This fixes crashes caused by 35e626bd0e
which made us start referencing the instance in the allocators. With
this commit, the tests now happily pass again.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100877
Tested-by: Vinson Lee <vlee@freedesktop.org>
This commit is contained in:
parent
6681ab1f97
commit
6ef1bd4fa5
|
@ -107,7 +107,10 @@ static void validate_monotonic(uint32_t **blocks)
|
||||||
|
|
||||||
static void run_test()
|
static void run_test()
|
||||||
{
|
{
|
||||||
struct anv_device device;
|
struct anv_instance instance;
|
||||||
|
struct anv_device device = {
|
||||||
|
.instance = &instance,
|
||||||
|
};
|
||||||
struct anv_block_pool pool;
|
struct anv_block_pool pool;
|
||||||
|
|
||||||
pthread_mutex_init(&device.mutex, NULL);
|
pthread_mutex_init(&device.mutex, NULL);
|
||||||
|
|
|
@ -34,7 +34,10 @@
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
struct anv_device device;
|
struct anv_instance instance;
|
||||||
|
struct anv_device device = {
|
||||||
|
.instance = &instance,
|
||||||
|
};
|
||||||
struct anv_block_pool block_pool;
|
struct anv_block_pool block_pool;
|
||||||
struct anv_state_pool state_pool;
|
struct anv_state_pool state_pool;
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,10 @@
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
struct anv_device device;
|
struct anv_instance instance;
|
||||||
|
struct anv_device device = {
|
||||||
|
.instance = &instance,
|
||||||
|
};
|
||||||
struct anv_block_pool block_pool;
|
struct anv_block_pool block_pool;
|
||||||
struct anv_state_pool state_pool;
|
struct anv_state_pool state_pool;
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,10 @@ static void *alloc_states(void *_job)
|
||||||
|
|
||||||
static void run_test()
|
static void run_test()
|
||||||
{
|
{
|
||||||
struct anv_device device;
|
struct anv_instance instance;
|
||||||
|
struct anv_device device = {
|
||||||
|
.instance = &instance,
|
||||||
|
};
|
||||||
struct anv_block_pool block_pool;
|
struct anv_block_pool block_pool;
|
||||||
struct anv_state_pool state_pool;
|
struct anv_state_pool state_pool;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue