diff options
-rw-r--r-- | tests/gem_flink_race.c | 8 | ||||
-rw-r--r-- | tests/prime_self_import.c | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/gem_flink_race.c b/tests/gem_flink_race.c index 3353b83e..f129cb30 100644 --- a/tests/gem_flink_race.c +++ b/tests/gem_flink_race.c @@ -163,6 +163,11 @@ static void test_flink_close(void) int r, i, num_threads; int obj_count; void *status; + int fake; + + /* Allocate exit handler fds in here so that we dont screw + * up the counts */ + fake = drm_open_any(); obj_count = get_object_count(); @@ -193,6 +198,9 @@ static void test_flink_close(void) obj_count = get_object_count() - obj_count; printf("leaked %i objects\n", obj_count); + + close(fake); + igt_assert(obj_count == 0); } diff --git a/tests/prime_self_import.c b/tests/prime_self_import.c index efdd24f6..41c203f9 100644 --- a/tests/prime_self_import.c +++ b/tests/prime_self_import.c @@ -258,6 +258,11 @@ static void test_reimport_close_race(void) int obj_count; void *status; uint32_t handle; + int fake; + + /* Allocate exit handler fds in here so that we dont screw + * up the counts */ + fake = drm_open_any(); obj_count = get_object_count(); @@ -294,6 +299,9 @@ static void test_reimport_close_race(void) obj_count = get_object_count() - obj_count; printf("leaked %i objects\n", obj_count); + + close(fake); + igt_assert(obj_count == 0); } |