[waffle] [PATCH 5/8] test/gl_basic_test: deduplicate gl_(debug, fwdcompat) tests

Emil Velikov emil.l.velikov at gmail.com
Mon Aug 4 07:34:20 PDT 2014


Both tests are identical across all linux platforms, even the upcoming
WGL implementation will be able to use them.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 tests/functional/gl_basic_test.c | 64 ++++++++++++----------------------------
 1 file changed, 19 insertions(+), 45 deletions(-)

diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c
index ee5a33f..633d6be 100644
--- a/tests/functional/gl_basic_test.c
+++ b/tests/functional/gl_basic_test.c
@@ -428,6 +428,19 @@ TEST(gl_basic, all_gl21_fwdcompat_bad_attribute)
 // List of linux (glx, wayland and x11_egl) specific tests.
 //
 #if defined(WAFFLE_HAS_GLX) || defined(WAFFLE_HAS_WAYLAND) || defined(WAFFLE_HAS_X11_EGL)
+TEST(gl_basic, linux_gl_debug)
+{
+    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
+                  .debug=true);
+}
+
+TEST(gl_basic, linux_gl_fwdcompat_bad_attribute)
+{
+    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
+                  .forward_compatible=true,
+                  .expect_error=WAFFLE_ERROR_BAD_ATTRIBUTE);
+}
+
 TEST(gl_basic, linux_gl30)
 {
     gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
@@ -815,19 +828,6 @@ TEST(gl_basic, glx_init)
     gl_basic_init(WAFFLE_PLATFORM_GLX);
 }
 
-TEST(gl_basic, glx_gl_debug)
-{
-    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
-                  .debug=true);
-}
-
-TEST(gl_basic, glx_gl_fwdcompat_bad_attribute)
-{
-    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
-                  .forward_compatible=true,
-                  .expect_error=WAFFLE_ERROR_BAD_ATTRIBUTE);
-}
-
 static void
 testsuite_glx(void)
 {
@@ -835,8 +835,8 @@ testsuite_glx(void)
 
     TEST_RUN(gl_basic, all_gl_rgb);
     TEST_RUN(gl_basic, all_gl_rgba);
-    TEST_RUN(gl_basic, glx_gl_debug);
-    TEST_RUN(gl_basic, glx_gl_fwdcompat_bad_attribute);
+    TEST_RUN(gl_basic, linux_gl_debug);
+    TEST_RUN(gl_basic, linux_gl_fwdcompat_bad_attribute);
 
     TEST_RUN(gl_basic, all_gl10);
     TEST_RUN(gl_basic, all_gl11);
@@ -895,19 +895,6 @@ TEST(gl_basic, wayland_init)
     gl_basic_init(WAFFLE_PLATFORM_WAYLAND);
 }
 
-TEST(gl_basic, wayland_gl_debug)
-{
-    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
-                  .debug=true);
-}
-
-TEST(gl_basic, wayland_gl_fwdcompat_bad_attribute)
-{
-    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
-                  .forward_compatible=true,
-                  .expect_error=WAFFLE_ERROR_BAD_ATTRIBUTE);
-}
-
 static void
 testsuite_wayland(void)
 {
@@ -916,8 +903,8 @@ testsuite_wayland(void)
     TEST_RUN(gl_basic, all_gl_rgb);
     TEST_RUN(gl_basic, all_gl_rgba);
 
-    TEST_RUN(gl_basic, wayland_gl_debug);
-    TEST_RUN(gl_basic, wayland_gl_fwdcompat_bad_attribute);
+    TEST_RUN(gl_basic, linux_gl_debug);
+    TEST_RUN(gl_basic, linux_gl_fwdcompat_bad_attribute);
 
     TEST_RUN(gl_basic, all_gl10);
     TEST_RUN(gl_basic, all_gl11);
@@ -976,19 +963,6 @@ TEST(gl_basic, x11_egl_init)
     gl_basic_init(WAFFLE_PLATFORM_X11_EGL);
 }
 
-TEST(gl_basic, x11_egl_gl_debug)
-{
-    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
-                  .debug=true);
-}
-
-TEST(gl_basic, x11_egl_gl_fwdcompat_bad_attribute)
-{
-    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
-                  .forward_compatible=true,
-                  .expect_error=WAFFLE_ERROR_BAD_ATTRIBUTE);
-}
-
 static void
 testsuite_x11_egl(void)
 {
@@ -996,8 +970,8 @@ testsuite_x11_egl(void)
 
     TEST_RUN(gl_basic, all_gl_rgb);
     TEST_RUN(gl_basic, all_gl_rgba);
-    TEST_RUN(gl_basic, x11_egl_gl_debug);
-    TEST_RUN(gl_basic, x11_egl_gl_fwdcompat_bad_attribute);
+    TEST_RUN(gl_basic, linux_gl_debug);
+    TEST_RUN(gl_basic, linux_gl_fwdcompat_bad_attribute);
 
     TEST_RUN(gl_basic, all_gl10);
     TEST_RUN(gl_basic, all_gl11);
-- 
2.0.2



More information about the waffle mailing list