On 5 March 2012 22:12, Eric Anholt <span dir="ltr"><<a href="mailto:eric@anholt.net">eric@anholt.net</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Fri, 2 Mar 2012 15:40:24 -0800, Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>> wrote:<br>
> This patch converts the following tests to use the main() function in<br>
> piglit-frmework.c rather than define their own main() function.<br>
<br>
</div>piglit-framework.c<br>
<div class="im"><br>
> -static void display(void)<br>
> +enum piglit_result<br>
> +piglit_display(void)<br>
> {<br>
> static int goterrors = 0;<br>
> static int frame = 0;<br>
> @@ -29,21 +31,12 @@ static void display(void)<br>
> goterrors++;<br>
> }<br>
><br>
> - if (Automatic && frame > 2) {<br>
> - printf("PIGLIT: {'result': '%s' }\n", goterrors ? "fail" : "pass");<br>
> - exit(0);<br>
> - }<br>
> + piglit_present_results();<br>
><br>
> - glutPostRedisplay();<br>
> + return goterrors ? PIGLIT_FAIL : PIGLIT_PASS;<br>
> }<br>
<br>
</div>I don't think this is an equivalent change. glutPostRedisplay()<br>
requested that glut's mainloop call our display function again (thus the<br>
frame++ counting). Just calling the display function twice from<br>
piglit_display ought to work.<br></blockquote><div><br>Any idea why the original test displayed two frames in the first place? I had a look at the bug report the test was based on (<a href="https://bugs.freedesktop.org/show_bug.cgi?id=9833">https://bugs.freedesktop.org/show_bug.cgi?id=9833</a>), and it seems like the sort of bug that would be expected to happen on every frame, or not at all.<br>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Other than that,<br>
<br>
Reviewed-by: Eric Anholt <<a href="mailto:eric@anholt.net">eric@anholt.net</a>><br>
</blockquote></div><br>