[Piglit] [PATCH v3] gl30basic: add some extra suspected extension

Dylan Baker dylan at pnwbakers.com
Wed Jun 28 17:03:54 UTC 2017


Quoting sandra koroniewska (2017-06-28 04:47:29)
> "The logic here seems dubious to me. How can the inner if statement ever be
> true,
> given that you've already checked that the extension string is empty or starts
> with 'GL_'?"
> 
> Strncmp returns 0 if contents of both strings are equal, so it checks that the
> string does not start with "GL_".
> 
> "if (!ext || strncmp(ext, "GL_", 3) || strncmp(ext, "WGL_EXT_swap_control",
> 20)) {
> ...
> }"
> 
> So this will not work, because if string begins with "GL_" the third condition
> will be met and PIGLIT_FAIL will be returned.
> 
> But you have a point when it comes to the first condition (!ext). I will
> extract this one and check the others after this.
> I will also add a comment about WGL_EXT_swap_control and update the patch.
> 
> Thanks,
> Sandra

Ah, I didn't realize that strcmp could return any value other than 0 or > 0,
Ilia's suggestion is the correct implementation of what I was getting at.

Dylan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20170628/40bf6eef/attachment.sig>


More information about the Piglit mailing list