[Piglit] Testing an unsupported function?

Chad Versace chad.versace at intel.com
Wed Dec 31 18:26:09 PST 2014


On 12/28/2014 10:21 PM, Tapani Pälli wrote:
> 
> On 12/23/2014 12:35 AM, Ian Romanick wrote:
>> How do I make a piglit test that calls an unsupported function?  I want
>> to verify that calling a function not supported by the context either
>> crashes or generates GL_INVALID_OPERATION.  All of the piglit_dispatch
>> infrastructure seems to put too much padding around things to make this
>> possible.
>>
>> Suggestions?
> 
> One (bit painful) way would be to dlopen and dlsym the function?

#ifdef PIGLIT_USE_WAFFLE
  // waffle_get_proc_address is a wrapper for:
  //   - eglGetProcAddress on EGL
  //   - glXGetProcAddress on GLX
  //   - wglGetProcAddress on WGL
  //   - dlsym on CGL (Mac), because that's how you do things on a Mac
  func = waffle_get_proc_address("func_name");
#endif

Of course, on WGL your extension must be sufficiently recent to be
able to use GetProcAddress. And on EGL 1.4, it must really be an
extension function, not a OpenGL ES 3.x function.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20141231/545e02b3/attachment-0001.sig>


More information about the Piglit mailing list