summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChad Versace <chad.versace@linux.intel.com>2012-11-12 19:00:15 -0800
committerChad Versace <chad.versace@linux.intel.com>2012-11-12 21:04:04 -0800
commitac3772f1e570427ebba0b6ab9661e0a073d9bd0a (patch)
tree4352a0dc5f3ccf7862c420778bf8df07fa10e08a /tests
parent08d0f65b9a34ffb3ee38755d3cf161ba9309c469 (diff)
tests/gl_basic: Refactor filling of config attrib list
Replace the array literal with a sequence of array assignments like `attrib_list[i++] = x`. This will provide more flexibility in a future commit. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/gl_basic_test.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c
index 2f089f2..8809b23 100644
--- a/tests/functional/gl_basic_test.c
+++ b/tests/functional/gl_basic_test.c
@@ -166,17 +166,8 @@ gl_basic_draw(int32_t waffle_context_api,
{
int32_t libgl;
- static const int config_context_api_index = 1;
-
- int32_t config_attrib_list[] = {
- WAFFLE_CONTEXT_API, 3141592653,
-
- WAFFLE_RED_SIZE, 8,
- WAFFLE_GREEN_SIZE, 8,
- WAFFLE_BLUE_SIZE, 8,
- WAFFLE_ALPHA_SIZE, alpha,
- 0,
- };
+ int32_t config_attrib_list[64];
+ int i;
struct waffle_display *dpy = NULL;
struct waffle_config *config = NULL;
@@ -184,7 +175,19 @@ gl_basic_draw(int32_t waffle_context_api,
struct waffle_context *ctx = NULL;
libgl = libgl_from_context_api(waffle_context_api);
- config_attrib_list[config_context_api_index] = waffle_context_api;
+
+ i = 0;
+ config_attrib_list[i++] = WAFFLE_CONTEXT_API;
+ config_attrib_list[i++] = waffle_context_api;
+ config_attrib_list[i++] = WAFFLE_RED_SIZE;
+ config_attrib_list[i++] = 8;
+ config_attrib_list[i++] = WAFFLE_GREEN_SIZE;
+ config_attrib_list[i++] = 8;
+ config_attrib_list[i++] = WAFFLE_BLUE_SIZE;
+ config_attrib_list[i++] = 8;
+ config_attrib_list[i++] = WAFFLE_ALPHA_SIZE;
+ config_attrib_list[i++] = alpha;
+ config_attrib_list[i++] = 0;
// Check that we've set the EGL_PLATFORM environment variable for Mesa.
//