MCPcopy Create free account
hub / github.com/cginternals/glbinding / TEST

Function TEST

source/tests/glbinding-test/Regression_test_198.cpp:25–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24
25TEST(Regression_198, releaseContext) // releaseContext(ctx) wipes out functions on contexts other than ctx #198
26{
27 try {
28 if (!glfwInit())
29 {
30 SUCCEED();
31 return;
32 }
33
34 glfwDefaultWindowHints();
35 glfwWindowHint(GLFW_VISIBLE, false);
36
37 auto context_A = glfwCreateWindow(320, 240, "Regression198-A", nullptr, nullptr);
38 ASSERT_NE(nullptr, context_A);
39 auto context_A_gl = context_cast(context_A);
40 glbinding::initialize(context_A_gl, ::glfwGetProcAddress, true, false);
41
42 auto context_B = glfwCreateWindow(320, 240, "Regression198-B", nullptr, nullptr);
43 ASSERT_NE(nullptr, context_B);
44 auto context_B_gl = context_cast(context_B);
45 glbinding::initialize(context_B_gl, ::glfwGetProcAddress, true, false);
46
47 glbinding::releaseContext(context_B_gl);
48 glfwDestroyWindow(context_B);
49
50 glfwMakeContextCurrent(context_A);
51 glbinding::useContext(context_A_gl);
52 gl::GLint major = 0;
53 glGetIntegerv(gl::GL_MAJOR_VERSION, &major);
54
55 glbinding::releaseContext(context_A_gl);
56 glfwDestroyWindow(context_A);
57 glfwTerminate();
58 } catch (std::out_of_range & ex) {
59 FAIL() << "Unexpected exception std::out_of_range thrown with message: " << ex.what();
60 } catch (...) {
61 SUCCEED();
62 }
63 SUCCEED();
64}

Callers

nothing calls this directly

Calls 5

context_castFunction · 0.85
initializeFunction · 0.85
releaseContextFunction · 0.85
useContextFunction · 0.85
glGetIntegervFunction · 0.50

Tested by

no test coverage detected