| 23 | |
| 24 | |
| 25 | TEST(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 | } |
nothing calls this directly
no test coverage detected