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

Function TEST

source/tests/glbinding-test/Regression_test_185.cpp:28–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26#ifdef BUILD_GPU_TESTS
27
28TEST(Regression_185, GLbooleanReturnValueCall) // GL calls fail if function returns GLboolean
29{
30 if (!glfwInit())
31 {
32 SUCCEED();
33 return;
34 }
35
36 glfwDefaultWindowHints();
37 glfwWindowHint(GLFW_VISIBLE, false);
38
39#ifdef SYSTEM_DARWIN
40 glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
41 glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
42 glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, true);
43 glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
44#endif
45
46 GLFWwindow * window = glfwCreateWindow(320, 240, "", nullptr, nullptr);
47 ASSERT_NE(nullptr, window);
48
49 glfwMakeContextCurrent(window);
50
51 glbinding::initialize(glfwGetProcAddress);
52
53 ASSERT_EQ(gl::GL_NO_ERROR, gl::glGetError());
54
55 // "Death Test": resolve a basic OpenGL of return type GLboolean (with underlying type char)
56 // note: this might work on some OpenGL drivers without expected failure (try NVIDIA for expected failure on windows x64)
57 ASSERT_NO_THROW(gl::glIsProgram(0));
58
59 ASSERT_EQ(gl::GL_NO_ERROR, gl::glGetError());
60
61 glfwMakeContextCurrent(nullptr);
62 glfwTerminate();
63
64 SUCCEED();
65}
66
67#endif
68

Callers

nothing calls this directly

Calls 3

initializeFunction · 0.85
glGetErrorFunction · 0.85
glIsProgramFunction · 0.85

Tested by

no test coverage detected