summaryrefslogtreecommitdiff
path: root/tests/prime_nv_api.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-07-15 11:04:20 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-07-15 11:04:20 +0200
commit4a9d50db1ba6e2733020ca35c0e5c43ae3bce4da (patch)
treea5ea0fae151af93e1683d23a85a2db56d4c4e6b2 /tests/prime_nv_api.c
parent1a3c7e349389bbb28bbf98b4738ab32c3cacd756 (diff)
test/prime_nv_api: more descriptive subtest names
Preprocessor magic ftw! Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/prime_nv_api.c')
-rw-r--r--tests/prime_nv_api.c58
1 files changed, 20 insertions, 38 deletions
diff --git a/tests/prime_nv_api.c b/tests/prime_nv_api.c
index 1785fda1..330edff2 100644
--- a/tests/prime_nv_api.c
+++ b/tests/prime_nv_api.c
@@ -74,7 +74,7 @@ static int find_and_open_devices(void)
return 0;
}
-static int test1(void)
+static int test_i915_nv_import_twice(void)
{
int ret;
drm_intel_bo *test_intel_bo;
@@ -104,7 +104,7 @@ out:
}
-static int test2(void)
+static int test_i915_nv_import_vs_close(void)
{
int ret;
drm_intel_bo *test_intel_bo;
@@ -136,7 +136,7 @@ out:
/* import handle twice on one driver */
-static int test3(void)
+static int test_i915_nv_double_import(void)
{
int ret;
drm_intel_bo *test_intel_bo;
@@ -171,7 +171,7 @@ out:
/* export handle twice from one driver - import twice
see if we get same object */
-static int test4(void)
+static int test_i915_nv_double_export(void)
{
int ret;
drm_intel_bo *test_intel_bo;
@@ -204,7 +204,7 @@ out:
/* export handle from intel driver - reimport to intel driver
see if you get same object */
-static int test5(void)
+static int test_i915_self_import(void)
{
int ret;
drm_intel_bo *test_intel_bo, *test_intel_bo2;
@@ -231,7 +231,7 @@ out:
}
/* nouveau export reimport test */
-static int test6(void)
+static int test_nv_self_import(void)
{
int ret;
int prime_fd;
@@ -259,7 +259,7 @@ static int test6(void)
/* export handle from intel driver - reimport to another intel driver bufmgr
see if you get same object */
-static int test7(void)
+static int test_i915_self_import_to_different_fd(void)
{
int ret;
drm_intel_bo *test_intel_bo, *test_intel_bo2;
@@ -285,7 +285,7 @@ out:
}
/* nouveau export reimport to other driver test */
-static int test8(void)
+static int test_nv_self_import_to_different_fd(void)
{
int ret;
int prime_fd;
@@ -368,38 +368,20 @@ int main(int argc, char **argv)
devid = intel_get_drm_devid(intel_fd);
intel_batch = intel_batchbuffer_alloc(bufmgr, devid);
- if (drmtest_run_subtest("test1"))
- if (test1())
- exit(2);
-
- if (drmtest_run_subtest("test2"))
- if (test2())
- exit(2);
-
- if (drmtest_run_subtest("test3"))
- if (test3())
- exit(2);
-
- if (drmtest_run_subtest("test4"))
- if (test4())
- exit(2);
-
- if (drmtest_run_subtest("test5"))
- if (test5())
- exit(2);
-
- if (drmtest_run_subtest("test6"))
- if (test6())
- exit(2);
-
- if (drmtest_run_subtest("test7"))
- if (test7())
- exit(2);
-
- if (drmtest_run_subtest("test8"))
- if (test8())
+#define xtest(name) \
+ if (drmtest_run_subtest(#name)) \
+ if (test_##name()) \
exit(2);
+ xtest(i915_nv_import_twice);
+ xtest(i915_nv_import_vs_close);
+ xtest(i915_nv_double_import);
+ xtest(i915_nv_double_export);
+ xtest(i915_self_import);
+ xtest(nv_self_import);
+ xtest(i915_self_import_to_different_fd);
+ xtest(nv_self_import_to_different_fd);
+
intel_batchbuffer_free(intel_batch);
nouveau_device_del(&ndev);