Similar to How can I force SDL_Init() to fail?, I'd like to force glfwInit()
to fail to ensure that my error logging code is working properly. How might I do this? I'm on Linux, so Linux-compatible answers are appreciated.
glfwInit()
may fail under a number of circumstances
xdg-shell
protocol (replaced wl-shell
).Your best bet is to look into the source code for GLFW. Try to see if you can find anything in _glfwInitX11
or _glfwInitWayland
that you can make fail.
If none of this can be achieved, you could try compiling GLFW yourself, after having rewritten glfwInit
to fail for every call.