glUseProgram should throw GL_INVALID_OPERATION error if program could not be made part of current state.
If the program is 0 or was not generated by OpenGL, others opengl implementations are returning GL_INVALID_VALUE