[waffle] [PATCH 1/8] test/gl_basic_test: add all_gl_rgb(a) tests

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


Neither one if the tests is platform specific, thus rename them to
all_* and drop the unneeded duplication.

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

diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c
index ff2f983..117df00 100644
--- a/tests/functional/gl_basic_test.c
+++ b/tests/functional/gl_basic_test.c
@@ -352,6 +352,21 @@ gl_basic_draw__(struct gl_basic_draw_args__ args)
     ASSERT_TRUE(waffle_display_disconnect(dpy));
 }
 
+//
+// List of tests common to all platforms.
+//
+
+TEST(gl_basic, all_gl_rgb)
+{
+    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL);
+}
+
+TEST(gl_basic, all_gl_rgba)
+{
+    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
+                  .alpha=true);
+}
+
 #ifdef WAFFLE_HAS_CGL
 TEST(gl_basic, cgl_init)
 {
@@ -370,17 +385,6 @@ TEST(gl_basic, cgl_gles2_unsupported)
                   .expect_error=WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM);
 }
 
-TEST(gl_basic, cgl_gl_rgb)
-{
-    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL);
-}
-
-TEST(gl_basic, cgl_gl_rgba)
-{
-    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
-                  .alpha=true);
-}
-
 TEST(gl_basic, cgl_gl_debug_is_unsupported)
 {
     gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
@@ -559,8 +563,8 @@ testsuite_cgl(void)
     TEST_RUN(gl_basic, cgl_gles1_unsupported);
     TEST_RUN(gl_basic, cgl_gles2_unsupported);
 
-    TEST_RUN(gl_basic, cgl_gl_rgb);
-    TEST_RUN(gl_basic, cgl_gl_rgba);
+    TEST_RUN(gl_basic, all_gl_rgb);
+    TEST_RUN(gl_basic, all_gl_rgba);
 
     TEST_RUN(gl_basic, cgl_gl_debug_is_unsupported);
     TEST_RUN(gl_basic, cgl_gl_fwdcompat_bad_attribute);
@@ -598,17 +602,6 @@ TEST(gl_basic, glx_init)
     gl_basic_init(WAFFLE_PLATFORM_GLX);
 }
 
-TEST(gl_basic, glx_gl_rgb)
-{
-    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL);
-}
-
-TEST(gl_basic, glx_gl_rgba)
-{
-    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
-                  .alpha=true);
-}
-
 TEST(gl_basic, glx_gl_debug)
 {
     gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
@@ -881,8 +874,8 @@ testsuite_glx(void)
 {
     TEST_RUN(gl_basic, glx_init);
 
-    TEST_RUN(gl_basic, glx_gl_rgb);
-    TEST_RUN(gl_basic, glx_gl_rgba);
+    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);
 
@@ -942,17 +935,6 @@ TEST(gl_basic, wayland_init)
     gl_basic_init(WAFFLE_PLATFORM_WAYLAND);
 }
 
-TEST(gl_basic, wayland_gl_rgb)
-{
-    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL);
-}
-
-TEST(gl_basic, wayland_gl_rgba)
-{
-    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
-                  .alpha=true);
-}
-
 TEST(gl_basic, wayland_gl_debug)
 {
     gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
@@ -1225,8 +1207,9 @@ testsuite_wayland(void)
 {
     TEST_RUN(gl_basic, wayland_init);
 
-    TEST_RUN(gl_basic, wayland_gl_rgb);
-    TEST_RUN(gl_basic, wayland_gl_rgba);
+    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);
 
@@ -1286,17 +1269,6 @@ TEST(gl_basic, x11_egl_init)
     gl_basic_init(WAFFLE_PLATFORM_X11_EGL);
 }
 
-TEST(gl_basic, x11_egl_gl_rgb)
-{
-    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL);
-}
-
-TEST(gl_basic, x11_egl_gl_rgba)
-{
-    gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
-                  .alpha=true);
-}
-
 TEST(gl_basic, x11_egl_gl_debug)
 {
     gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
@@ -1569,8 +1541,8 @@ testsuite_x11_egl(void)
 {
     TEST_RUN(gl_basic, x11_egl_init);
 
-    TEST_RUN(gl_basic, x11_egl_gl_rgb);
-    TEST_RUN(gl_basic, x11_egl_gl_rgba);
+    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);
 
-- 
2.0.2



More information about the waffle mailing list