On 5 March 2012 22:12, Eric Anholt <span dir="ltr">&lt;<a href="mailto:eric@anholt.net">eric@anholt.net</a>&gt;</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 &lt;<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>&gt; wrote:<br>
&gt; This patch converts the following tests to use the main() function in<br>
&gt; piglit-frmework.c rather than define their own main() function.<br>
<br>
</div>piglit-framework.c<br>
<div class="im"><br>
&gt; -static void display(void)<br>
&gt; +enum piglit_result<br>
&gt; +piglit_display(void)<br>
&gt;  {<br>
&gt;       static int goterrors = 0;<br>
&gt;       static int frame = 0;<br>
&gt; @@ -29,21 +31,12 @@ static void display(void)<br>
&gt;               goterrors++;<br>
&gt;       }<br>
&gt;<br>
&gt; -     if (Automatic &amp;&amp; frame &gt; 2) {<br>
&gt; -             printf(&quot;PIGLIT: {&#39;result&#39;: &#39;%s&#39; }\n&quot;, goterrors ? &quot;fail&quot; : &quot;pass&quot;);<br>
&gt; -             exit(0);<br>
&gt; -     }<br>
&gt; +     piglit_present_results();<br>
&gt;<br>
&gt; -     glutPostRedisplay();<br>
&gt; +     return goterrors ? PIGLIT_FAIL : PIGLIT_PASS;<br>
&gt;  }<br>
<br>
</div>I don&#39;t think this is an equivalent change.  glutPostRedisplay()<br>
requested that glut&#39;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 &lt;<a href="mailto:eric@anholt.net">eric@anholt.net</a>&gt;<br>
</blockquote></div><br>