<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Looks good.</p>
<p><br>
</p>
<p>Reviewed-by: Neha Bhende <bhenden@vmware.com><br>
</p>
<p><br>
</p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" style="font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>Regards,</p>
<p>Neha<br>
</p>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Brian Paul <brianp@vmware.com><br>
<b>Sent:</b> Friday, June 16, 2017 3:44:11 PM<br>
<b>To:</b> piglit@lists.freedesktop.org<br>
<b>Cc:</b> Charmaine Lee; Neha Bhende; Brian Paul<br>
<b>Subject:</b> [PATCH] polygon-mode: print more info if there's a failure</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Also simplify the code a bit and fix incorrect comments.<br>
---<br>
tests/general/polygon-mode.c | 28 ++++++++++++----------------<br>
1 file changed, 12 insertions(+), 16 deletions(-)<br>
<br>
diff --git a/tests/general/polygon-mode.c b/tests/general/polygon-mode.c<br>
index ce109c1..2ca9f8e 100644<br>
--- a/tests/general/polygon-mode.c<br>
+++ b/tests/general/polygon-mode.c<br>
@@ -48,25 +48,25 @@ static const char *TestName = "polygon-mode";<br>
#define VERTS 16<br>
<br>
static const GLfloat Positions[VERTS][2] = {<br>
- /* clockwise */<br>
+ /* counter-clockwise, front facing */<br>
{ 0, -1 },<br>
{ 1, -1 },<br>
{ 1, 1 },<br>
{ 0, 1 },<br>
<br>
- /* counter-clockwise */<br>
+ /* clockwise, back facing */<br>
{ 2, -1 },<br>
{ 2, 1 },<br>
{ 3, 1 },<br>
{ 3, -1 },<br>
<br>
- /* clockwise */<br>
+ /* counter-clockwise, front facing */<br>
{ 4, -1 },<br>
{ 5, -1 },<br>
{ 5, 1 },<br>
{ 4, 1 },<br>
<br>
- /* counter-clockwise */<br>
+ /* clockwise, back facing */<br>
{ 6, -1 },<br>
{ 6, 1 },<br>
{ 7, 1 },<br>
@@ -250,23 +250,17 @@ test_combo(GLenum frontMode, GLenum backMode)<br>
<br>
/* determine what kind of primitives were drawn */<br>
for (i = 0; i < 4; i++) {<br>
- bool err = false;<br>
+ GLenum testMode = (i & 1) ? backMode : frontMode;<br>
+<br>
expectedPrims[i] = identify_primitive(&Positions[4 * i], Colors[4 * i]);<br>
- if (i & 1) {<br>
- if (expectedPrims[i] != backMode) {<br>
- err = true;<br>
- }<br>
- }<br>
- else {<br>
- if (expectedPrims[i] != frontMode) {<br>
- err = true;<br>
- }<br>
- }<br>
- if (err) {<br>
+<br>
+ if (expectedPrims[i] != testMode) {<br>
/* we didn't get the expected reference primitive */<br>
fprintf(stderr,<br>
"%s: reference drawing failed for frontPrim=%s, backPrim=%s\n",<br>
TestName, get_mode_str(frontMode), get_mode_str(backMode));<br>
+ fprintf(stderr, "At position %d, found prim %s instead of %s\n",<br>
+ i, get_mode_str(expectedPrims[i]), get_mode_str(testMode));<br>
return GL_FALSE;<br>
}<br>
}<br>
@@ -283,6 +277,8 @@ test_combo(GLenum frontMode, GLenum backMode)<br>
if (prim != expectedPrims[i]) {<br>
fprintf(stderr, "%s: glPolygonMode(front=%s, back=%s) failed\n",<br>
TestName, get_mode_str(frontMode), get_mode_str(backMode));<br>
+ fprintf(stderr, "At position %d, found prim %s instead of %s\n",<br>
+ i, get_mode_str(prim), get_mode_str(expectedPrims[i]));<br>
pass = GL_FALSE;<br>
}<br>
}<br>
-- <br>
1.9.1<br>
<br>
</div>
</span></font>
</body>
</html>