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:
Jason Ekstrand 2017-05-01 16:48:12 -07:00
parent 6681ab1f97
commit 6ef1bd4fa5
4 changed files with 16 additions and 4 deletions

View File

@ -107,7 +107,10 @@ static void validate_monotonic(uint32_t **blocks)
static void run_test()
{
struct anv_device device;
struct anv_instance instance;
struct anv_device device = {
.instance = &instance,
};
struct anv_block_pool pool;
pthread_mutex_init(&device.mutex, NULL);

View File

@ -34,7 +34,10 @@
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_state_pool state_pool;

View File

@ -33,7 +33,10 @@
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_state_pool state_pool;

View File

@ -54,7 +54,10 @@ static void *alloc_states(void *_job)
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_state_pool state_pool;