diff mbox

[i-g-t,v4,03/13] tests/sw_sync: Add subtest test_alloc_fence

Message ID 20160914150442.18183-4-robert.foss@collabora.com (mailing list archive)
State New, archived
Headers show

Commit Message

Robert Foss Sept. 14, 2016, 3:04 p.m. UTC
From: Robert Foss <robert.foss@collabora.com>

Add subtest alloc_fence that verifies that it's possible to allocate a fence
on a timeline.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
---
 tests/sw_sync.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff mbox

Patch

diff --git a/tests/sw_sync.c b/tests/sw_sync.c
index 47e2dfa..8f6208b 100644
--- a/tests/sw_sync.c
+++ b/tests/sw_sync.c
@@ -44,9 +44,25 @@  static void test_alloc_timeline(void)
 	close(timeline);
 }
 
+static void test_alloc_fence(void)
+{
+	int in_fence;
+	int timeline;
+
+	timeline = sw_sync_timeline_create();
+	in_fence = sw_sync_fence_create(timeline, 0);
+
+	close(in_fence);
+	close(timeline);
+}
+
+
 igt_main
 {
 	igt_subtest("alloc_timeline")
 		test_alloc_timeline();
+
+	igt_subtest("alloc_fence")
+		test_alloc_fence();
 }