[Piglit] [PATCH v8] Port basic GL rendering test from Glean to Piglit

Emil Velikov emil.l.velikov at gmail.com
Thu Sep 17 11:58:22 PDT 2015


Hi Brian,

On 17 September 2015 at 18:12, Brian Paul <brianp at vmware.com> wrote:
> Just a few more minor things...
>
>
>
> On 09/16/2015 03:23 PM, Juliet Fru wrote:

>> --- /dev/null
>> +++ b/tests/spec/gl-1.0/no-op-paths.c
>> @@ -0,0 +1,305 @@

>> +enum path
>> +{
>> +       ALPHA,
>> +       BLEND,
>> +       COLOR_MASK,
>> +       DEPTH,
>> +       LOGIC,
>> +       SCISSOR,
>> +       STENCIL,
>> +       STIPPLE,
>> +       TEXTURE,
>> +       NUM_PATHS               /* end-of-list token */
>> +};
>> +

>> +const char *
>> +path_name(enum path paths)
>> +{
>> +       switch (paths) {
>> +       case ALPHA:
>> +               return "Alpha Test";
>> +       case BLEND:
>> +               return "Blending";
>> +       case COLOR_MASK:
>> +               return "Color Mask";
>> +       case DEPTH:
>> +               return "Depth Test";
>> +       case LOGIC:
>> +               return "LogicOp";
>> +       case SCISSOR:
>> +               return "Scissor Test";
>> +       case STENCIL:
>> +               return "Stencil Test";
>> +       case STIPPLE:
>> +               return "Polygon Stipple";
>> +       case TEXTURE:
>> +               return "Modulated Texture";
>> +       case NUM_PATHS:
>> +               return "paths";
>
>
> We need a default case here just to silence a compiler warning. Something
> like:
>
>         default:
>                 return "BAD PATH VALUE!";
>
I believe I'm the one to blame for the missing default statement here.
Afaics every value of the enum is handled so if the compiler is
throwing a warning, it has gone bonkers :-)

Just throwing it out there.

-Emil


More information about the Piglit mailing list