summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2012-10-29 16:06:03 -0700
committerJordan Justen <jordan.l.justen@intel.com>2012-11-03 10:54:41 -0700
commit3b64f4b4fb618b57b3052b433265b1349b5e7f6b (patch)
tree7887fca10b8fa8c0ef66b2e7eacfe43d0251ff8f
parent83b6a7cdaa86e2859177abab0e0117f208ddbe6c (diff)
dispatch_sanity test: create common context creation function
We also no longer call _swrast_CreateContext, _tnl_CreateContext or _swsetup_CreateContext when creating the context. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
-rw-r--r--src/mesa/main/tests/dispatch_sanity.cpp52
1 files changed, 16 insertions, 36 deletions
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index a54653b8028..a80af440ff9 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -83,6 +83,7 @@ extern const struct function gles11_functions_possible[];
class DispatchSanity_test : public ::testing::Test {
public:
virtual void SetUp();
+ void SetUpCtx(gl_api api, unsigned int version);
struct gl_config visual;
struct dd_function_table driver_functions;
@@ -101,6 +102,18 @@ DispatchSanity_test::SetUp()
_mesa_init_driver_functions(&driver_functions);
}
+void
+DispatchSanity_test::SetUpCtx(gl_api api, unsigned int version)
+{
+ ctx.Version = version;
+ _mesa_initialize_context(&ctx,
+ api,
+ &visual,
+ NULL, // share_list
+ &driver_functions);
+ _vbo_CreateContext(&ctx);
+}
+
static const char *
offset_to_proc_name_safe(unsigned offset)
{
@@ -159,18 +172,7 @@ validate_nops(struct gl_context *ctx)
#if FEATURE_ES1
TEST_F(DispatchSanity_test, GLES11)
{
- ctx.Version = 11;
- _mesa_initialize_context(&ctx,
- API_OPENGLES,
- &visual,
- NULL /* share_list */,
- &driver_functions);
-
- _swrast_CreateContext(&ctx);
- _vbo_CreateContext(&ctx);
- _tnl_CreateContext(&ctx);
- _swsetup_CreateContext(&ctx);
-
+ SetUpCtx(API_OPENGLES, 11);
validate_functions(&ctx, gles11_functions_possible);
validate_nops(&ctx);
}
@@ -178,36 +180,14 @@ TEST_F(DispatchSanity_test, GLES11)
TEST_F(DispatchSanity_test, GLES2)
{
- ctx.Version = 20;
- _mesa_initialize_context(&ctx,
- API_OPENGLES2, //api,
- &visual,
- NULL, //&share_list,
- &driver_functions);
-
- _swrast_CreateContext(&ctx);
- _vbo_CreateContext(&ctx);
- _tnl_CreateContext(&ctx);
- _swsetup_CreateContext(&ctx);
-
+ SetUpCtx(API_OPENGLES2, 20);
validate_functions(&ctx, gles2_functions_possible);
validate_nops(&ctx);
}
TEST_F(DispatchSanity_test, GLES3)
{
- ctx.Version = 30;
- _mesa_initialize_context(&ctx,
- API_OPENGLES2, //api,
- &visual,
- NULL, //&share_list,
- &driver_functions);
-
- _swrast_CreateContext(&ctx);
- _vbo_CreateContext(&ctx);
- _tnl_CreateContext(&ctx);
- _swsetup_CreateContext(&ctx);
-
+ SetUpCtx(API_OPENGLES2, 30);
validate_functions(&ctx, gles2_functions_possible);
validate_functions(&ctx, gles3_functions_possible);
validate_nops(&ctx);