Commit 6f7ac70b authored by Matt Turner's avatar Matt Turner

egl_khr_create_context: Allow forward-compatible contexts to be rejected

This reworks the test to test whether
	1) forward-compatible contexts can be created, or
	2) the correct error is generated when they can't.

Previously the test did only the first and would fail if
forward-compatible contexts couldn't be created.
parent 8a0388a1
......@@ -20,6 +20,7 @@
* IN THE SOFTWARE.
*/
#include "piglit-util-gl-common.h"
#include "piglit-util-egl.h"
#include "common.h"
int gl_version;
......@@ -47,11 +48,19 @@ static bool try_flag(int flag)
gl_version = piglit_get_gl_version();
}
eglDestroyContext(egl_dpy, ctx);
return true;
} else {
fprintf(stderr, "Failed to create context with flag %d\n", flag);
/* The EGL_KHR_create_context spec says:
*
* "* If an attribute name or attribute value in <attrib_list> is not
* recognized (including unrecognized bits in bitmask attributes),
* then an EGL_BAD_ATTRIBUTE error is generated."
*/
piglit_expect_egl_error(EGL_BAD_ATTRIBUTE, PIGLIT_FAIL);
}
fprintf(stderr, "Failed to create context with flag %d\n", flag);
return false;
return true;
}
int main(int argc, char **argv)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment