[waffle] [PATCH 08/29] tests/gl_basic: add test_glXX_fwdcompat() macro
Emil Velikov
emil.l.velikov at gmail.com
Wed Jan 6 13:27:34 PST 2016
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
tests/functional/gl_basic_test.c | 66 ++++++++++++++++++----------------------
1 file changed, 30 insertions(+), 36 deletions(-)
diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c
index a14ce32..9ccf822 100644
--- a/tests/functional/gl_basic_test.c
+++ b/tests/functional/gl_basic_test.c
@@ -378,6 +378,15 @@ static void test_gl_basic_gl##waffle_version(void) \
.expect_error=WAFFLE_##error); \
}
+#define test_glXX_fwdcompat(waffle_version, error) \
+static void test_gl_basic_gl##waffle_version##_fwdcompat(void) \
+{ \
+ gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL, \
+ .version=waffle_version, \
+ .forward_compatible=true, \
+ .expect_error=WAFFLE_##error); \
+}
+
test_XX_rgb(gl, OPENGL, NO_ERROR)
test_XX_rgba(gl, OPENGL, NO_ERROR)
@@ -389,14 +398,7 @@ test_glXX(14, NO_ERROR)
test_glXX(15, NO_ERROR)
test_glXX(20, NO_ERROR)
test_glXX(21, NO_ERROR)
-
-TEST(gl_basic, all_gl21_fwdcompat_bad_attribute)
-{
- gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
- .version=21,
- .forward_compatible=true,
- .expect_error=WAFFLE_ERROR_BAD_ATTRIBUTE);
-}
+test_glXX_fwdcompat(21, ERROR_BAD_ATTRIBUTE)
//
@@ -417,22 +419,9 @@ TEST(gl_basic, all_but_cgl_gl_fwdcompat_bad_attribute)
}
test_glXX(30, NO_ERROR)
-
-TEST(gl_basic, all_but_cgl_gl30_fwdcompat)
-{
- gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
- .version=30,
- .forward_compatible=true);
-}
-
+test_glXX_fwdcompat(30, NO_ERROR)
test_glXX(31, NO_ERROR)
-
-TEST(gl_basic, all_but_cgl_gl31_fwdcompat)
-{
- gl_basic_draw(.api=WAFFLE_CONTEXT_OPENGL,
- .version=31,
- .forward_compatible=true);
-}
+test_glXX_fwdcompat(31, NO_ERROR)
TEST(gl_basic, all_but_cgl_gl32_core)
{
@@ -616,7 +605,9 @@ TEST(gl_basic, cgl_gl_fwdcompat_bad_attribute)
}
test_glXX(30, ERROR_UNSUPPORTED_ON_PLATFORM)
+test_glXX_fwdcompat(30, ERROR_UNSUPPORTED_ON_PLATFORM)
test_glXX(31, NO_ERROR)
+test_glXX_fwdcompat(31, ERROR_UNSUPPORTED_ON_PLATFORM)
TEST(gl_basic, cgl_gl32_core)
{
@@ -734,10 +725,12 @@ testsuite_cgl(void)
TEST_RUN(gl_basic, gl15);
TEST_RUN(gl_basic, gl20);
TEST_RUN(gl_basic, gl21);
- TEST_RUN2(gl_basic, cgl_gl21_fwdcompat_bad_attribute, all_gl21_fwdcompat_bad_attribute);
+ TEST_RUN(gl_basic, gl21_fwdcompat);
TEST_RUN(gl_basic, gl30);
+ TEST_RUN(gl_basic, gl30_fwdcompat);
TEST_RUN(gl_basic, gl31);
+ TEST_RUN(gl_basic, gl31_fwdcompat);
TEST_RUN(gl_basic, cgl_gl32_core);
TEST_RUN(gl_basic, cgl_gl33_core);
@@ -779,12 +772,12 @@ testsuite_glx(void)
TEST_RUN(gl_basic, gl15);
TEST_RUN(gl_basic, gl20);
TEST_RUN(gl_basic, gl21);
- TEST_RUN2(gl_basic, glx_gl21_fwdcompat_bad_attribute, all_gl21_fwdcompat_bad_attribute);
+ TEST_RUN(gl_basic, gl21_fwdcompat);
TEST_RUN(gl_basic, gl30);
- TEST_RUN2(gl_basic, glx_gl30_fwdcompat, all_but_cgl_gl30_fwdcompat);
+ TEST_RUN(gl_basic, gl30_fwdcompat);
TEST_RUN(gl_basic, gl31);
- TEST_RUN2(gl_basic, glx_gl31_fwdcompat, all_but_cgl_gl31_fwdcompat);
+ TEST_RUN(gl_basic, gl31_fwdcompat);
TEST_RUN2(gl_basic, glx_gl32_core, all_but_cgl_gl32_core);
TEST_RUN2(gl_basic, glx_gl32_core_fwdcompat, all_but_cgl_gl32_core_fwdcompat);
@@ -843,12 +836,12 @@ testsuite_wayland(void)
TEST_RUN(gl_basic, gl15);
TEST_RUN(gl_basic, gl20);
TEST_RUN(gl_basic, gl21);
- TEST_RUN2(gl_basic, wayland_gl21_fwdcompat_bad_attribute, all_gl21_fwdcompat_bad_attribute);
+ TEST_RUN(gl_basic, gl21_fwdcompat);
TEST_RUN(gl_basic, gl30);
- TEST_RUN2(gl_basic, wayland_gl30_fwdcompat, all_but_cgl_gl30_fwdcompat);
+ TEST_RUN(gl_basic, gl30_fwdcompat);
TEST_RUN(gl_basic, gl31);
- TEST_RUN2(gl_basic, wayland_gl31_fwdcompat, all_but_cgl_gl31_fwdcompat);
+ TEST_RUN(gl_basic, gl31_fwdcompat);
TEST_RUN2(gl_basic, wayland_gl32_core, all_but_cgl_gl32_core);
TEST_RUN2(gl_basic, wayland_gl32_core_fwdcompat, all_but_cgl_gl32_core_fwdcompat);
@@ -907,12 +900,12 @@ testsuite_x11_egl(void)
TEST_RUN(gl_basic, gl15);
TEST_RUN(gl_basic, gl20);
TEST_RUN(gl_basic, gl21);
- TEST_RUN2(gl_basic, x11_egl_gl21_fwdcompat_bad_attribute, all_gl21_fwdcompat_bad_attribute);
+ TEST_RUN(gl_basic, gl21_fwdcompat);
TEST_RUN(gl_basic, gl30);
- TEST_RUN2(gl_basic, x11_egl_gl30_fwdcompat, all_but_cgl_gl30_fwdcompat);
+ TEST_RUN(gl_basic, gl30_fwdcompat);
TEST_RUN(gl_basic, gl31);
- TEST_RUN2(gl_basic, x11_egl_gl31_fwdcompat, all_but_cgl_gl31_fwdcompat);
+ TEST_RUN(gl_basic, gl31_fwdcompat);
TEST_RUN2(gl_basic, x11_egl_gl32_core, all_but_cgl_gl32_core);
TEST_RUN2(gl_basic, x11_egl_gl32_core_fwdcompat, all_but_cgl_gl32_core_fwdcompat);
@@ -971,12 +964,12 @@ testsuite_wgl(void)
TEST_RUN(gl_basic, gl15);
TEST_RUN(gl_basic, gl20);
TEST_RUN(gl_basic, gl21);
- TEST_RUN(gl_basic, all_gl21_fwdcompat_bad_attribute);
+ TEST_RUN(gl_basic, gl21_fwdcompat);
TEST_RUN(gl_basic, gl30);
- TEST_RUN(gl_basic, all_but_cgl_gl30_fwdcompat);
+ TEST_RUN(gl_basic, gl30_fwdcompat);
TEST_RUN(gl_basic, gl31);
- TEST_RUN(gl_basic, all_but_cgl_gl31_fwdcompat);
+ TEST_RUN(gl_basic, gl31_fwdcompat);
TEST_RUN(gl_basic, all_but_cgl_gl32_core);
TEST_RUN(gl_basic, all_but_cgl_gl32_core_fwdcompat);
@@ -1011,6 +1004,7 @@ testsuite_wgl(void)
}
#endif // WAFFLE_HAS_WGL
+#undef test_glXX_fwdcompat
#undef test_glXX
#undef test_XX_rgba
--
2.6.2
More information about the waffle
mailing list