[waffle] [PATCH 10/29] tests/gl_basic: add test_glXX_core_fwdcompat() test macro
Emil Velikov
emil.l.velikov at gmail.com
Wed Jan 6 13:27:36 PST 2016
... and use it to minimise the duplication across the file.
Add the equivalent CGL test while we're here :)
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
tests/functional/gl_basic_test.c | 31 ++++++++++++++++++-------------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c
index f8cf2a1..ff1d6a3 100644
--- a/tests/functional/gl_basic_test.c
+++ b/tests/functional/gl_basic_test.c
@@ -396,6 +396,16 @@ static void test_gl_basic_gl##waffle_version##_core(void) \
.expect_error=WAFFLE_##error); \
}
+#define test_glXX_core_fwdcompat(waffle_version, error) \
+static void test_gl_basic_gl##waffle_version##_core_fwdcompat(void) \
+{ \
+ gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL, \
+ .version=waffle_version, \
+ .profile=WAFFLE_CONTEXT_CORE_PROFILE, \
+ .forward_compatible=true, \
+ .expect_error=WAFFLE_##error); \
+}
+
test_XX_rgb(gl, OPENGL, NO_ERROR)
test_XX_rgba(gl, OPENGL, NO_ERROR)
@@ -433,15 +443,7 @@ test_glXX(31, NO_ERROR)
test_glXX_fwdcompat(31, NO_ERROR)
test_glXX_core(32, NO_ERROR)
-
-TEST(gl_basic, all_but_cgl_gl32_core_fwdcompat)
-{
- gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
- .version=32,
- .profile=WAFFLE_CONTEXT_CORE_PROFILE,
- .forward_compatible=true);
-}
-
+test_glXX_core_fwdcompat(32, NO_ERROR)
test_glXX_core(33, NO_ERROR)
test_glXX_core(40, NO_ERROR)
test_glXX_core(41, NO_ERROR)
@@ -585,6 +587,7 @@ test_glXX(31, NO_ERROR)
test_glXX_fwdcompat(31, ERROR_UNSUPPORTED_ON_PLATFORM)
test_glXX_core(32, NO_ERROR)
+test_glXX_core_fwdcompat(32, ERROR_UNSUPPORTED_ON_PLATFORM)
test_glXX_core(33, ERROR_UNSUPPORTED_ON_PLATFORM)
test_glXX_core(40, ERROR_UNSUPPORTED_ON_PLATFORM)
test_glXX_core(41, ERROR_UNSUPPORTED_ON_PLATFORM)
@@ -668,6 +671,7 @@ testsuite_cgl(void)
TEST_RUN(gl_basic, gl31_fwdcompat);
TEST_RUN(gl_basic, gl32_core);
+ TEST_RUN(gl_basic, gl32_core_fwdcompat);
TEST_RUN(gl_basic, gl33_core);
TEST_RUN(gl_basic, gl40_core);
TEST_RUN(gl_basic, gl41_core);
@@ -715,7 +719,7 @@ testsuite_glx(void)
TEST_RUN(gl_basic, gl31_fwdcompat);
TEST_RUN(gl_basic, gl32_core);
- TEST_RUN2(gl_basic, glx_gl32_core_fwdcompat, all_but_cgl_gl32_core_fwdcompat);
+ TEST_RUN(gl_basic, gl32_core_fwdcompat);
TEST_RUN(gl_basic, gl33_core);
TEST_RUN(gl_basic, gl40_core);
TEST_RUN(gl_basic, gl41_core);
@@ -779,7 +783,7 @@ testsuite_wayland(void)
TEST_RUN(gl_basic, gl31_fwdcompat);
TEST_RUN(gl_basic, gl32_core);
- TEST_RUN2(gl_basic, wayland_gl32_core_fwdcompat, all_but_cgl_gl32_core_fwdcompat);
+ TEST_RUN(gl_basic, gl32_core_fwdcompat);
TEST_RUN(gl_basic, gl33_core);
TEST_RUN(gl_basic, gl40_core);
TEST_RUN(gl_basic, gl41_core);
@@ -843,7 +847,7 @@ testsuite_x11_egl(void)
TEST_RUN(gl_basic, gl31_fwdcompat);
TEST_RUN(gl_basic, gl32_core);
- TEST_RUN2(gl_basic, x11_egl_gl32_core_fwdcompat, all_but_cgl_gl32_core_fwdcompat);
+ TEST_RUN(gl_basic, gl32_core_fwdcompat);
TEST_RUN(gl_basic, gl33_core);
TEST_RUN(gl_basic, gl40_core);
TEST_RUN(gl_basic, gl41_core);
@@ -907,7 +911,7 @@ testsuite_wgl(void)
TEST_RUN(gl_basic, gl31_fwdcompat);
TEST_RUN(gl_basic, gl32_core);
- TEST_RUN(gl_basic, all_but_cgl_gl32_core_fwdcompat);
+ TEST_RUN(gl_basic, gl32_core_fwdcompat);
TEST_RUN(gl_basic, gl33_core);
TEST_RUN(gl_basic, gl40_core);
TEST_RUN(gl_basic, gl41_core);
@@ -939,6 +943,7 @@ testsuite_wgl(void)
}
#endif // WAFFLE_HAS_WGL
+#undef test_glXX_core_fwdcompat
#undef test_glXX_core
#undef test_glXX_fwdcompat
#undef test_glXX
--
2.6.2
More information about the waffle
mailing list