diff options
author | Jordan Justen <[email protected]> | 2012-10-16 20:50:03 -0700 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2012-11-03 10:54:41 -0700 |
commit | 7e64fe583f625c01d6a6eed664f5a4f808607830 (patch) | |
tree | df3572a509105488e93e512f9765a7955b968d1a /src | |
parent | 2ad1b13508664c57707ad450d7c1f5e701171d37 (diff) |
dispatch_sanity test: pass ctx to validate_functions/nops
This will allow validate_functions to access ctx->Version.
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/tests/dispatch_sanity.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index 1233b04ae88..474413cbf57 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -112,8 +112,10 @@ offset_to_proc_name_safe(unsigned offset) * _glapi_proc *table exist. When found, set their pointers in the table * to _mesa_generic_nop. */ static void -validate_functions(_glapi_proc *table, const struct function *function_table) +validate_functions(struct gl_context *ctx, const struct function *function_table) { + _glapi_proc *table = (_glapi_proc *) ctx->Exec; + for (unsigned i = 0; function_table[i].name != NULL; i++) { const int offset = (function_table[i].offset != -1) ? function_table[i].offset @@ -135,8 +137,10 @@ validate_functions(_glapi_proc *table, const struct function *function_table) /* Scan through the table and ensure that there is nothing except * _mesa_generic_nop (as set by validate_functions(). */ static void -validate_nops(const _glapi_proc *table) +validate_nops(struct gl_context *ctx) { + _glapi_proc *table = (_glapi_proc *) ctx->Exec; + const unsigned size = _glapi_get_dispatch_table_size(); for (unsigned i = 0; i < size; i++) { EXPECT_EQ((_glapi_proc) _mesa_generic_nop, table[i]) @@ -159,8 +163,8 @@ TEST_F(DispatchSanity_test, GLES11) _tnl_CreateContext(&ctx); _swsetup_CreateContext(&ctx); - validate_functions((_glapi_proc *) ctx.Exec, gles11_functions_possible); - validate_nops((_glapi_proc *) ctx.Exec); + validate_functions(&ctx, gles11_functions_possible); + validate_nops(&ctx); } #endif /* FEATURE_ES1 */ @@ -178,8 +182,8 @@ TEST_F(DispatchSanity_test, GLES2) _tnl_CreateContext(&ctx); _swsetup_CreateContext(&ctx); - validate_functions((_glapi_proc *) ctx.Exec, gles2_functions_possible); - validate_nops((_glapi_proc *) ctx.Exec); + validate_functions(&ctx, gles2_functions_possible); + validate_nops(&ctx); } TEST_F(DispatchSanity_test, GLES3) @@ -196,9 +200,9 @@ TEST_F(DispatchSanity_test, GLES3) _tnl_CreateContext(&ctx); _swsetup_CreateContext(&ctx); - validate_functions((_glapi_proc *) ctx.Exec, gles2_functions_possible); - validate_functions((_glapi_proc *) ctx.Exec, gles3_functions_possible); - validate_nops((_glapi_proc *) ctx.Exec); + validate_functions(&ctx, gles2_functions_possible); + validate_functions(&ctx, gles3_functions_possible); + validate_nops(&ctx); } #if FEATURE_ES1 |