<div dir="ltr">In light of Ian's rb, you could just upstream this commit and then send another patch to the ML that moves the macros to piglit-util-gl.h.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 17, 2015 at 2:46 PM, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">One nearly infinitesimal nit below, but otherwise<br>
<br>
Reviewed-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
<div><div class="h5"><br>
On 02/16/2015 05:12 AM, Martin Peres wrote:<br>
> v2: Feedback from Laura<br>
> - all.py: fix the test's name<br>
> - move the tests to the display() function<br>
> - fix the reporting of the macro<br>
> - stay in the 78 chars limit<br>
><br>
> v3:<br>
> - test that dsa-created BOs are seen as TransformFeedback BOs<br>
> - rework SUBTESTCONDITION as per Laura's comment<br>
> - fix the name for doxygen<br>
><br>
> v4:<br>
> - rework SUBTESTCONDITION to only execute the condition once<br>
><br>
> Signed-off-by: Martin Peres <<a href="mailto:martin.peres@linux.intel.com">martin.peres@linux.intel.com</a>><br>
> ---<br>
>  tests/all.py                                       |  1 +<br>
>  .../spec/arb_direct_state_access/CMakeLists.gl.txt |  1 +<br>
>  .../create-transformfeedbacks.c                    | 75 ++++++++++++++++++++++<br>
>  tests/spec/arb_direct_state_access/dsa-utils.h     | 16 +++++<br>
>  4 files changed, 93 insertions(+)<br>
>  create mode 100644 tests/spec/arb_direct_state_access/create-transformfeedbacks.c<br>
><br>
> diff --git a/tests/all.py b/tests/all.py<br>
> index d2ae5ea..dce9ae2 100644<br>
> --- a/tests/all.py<br>
> +++ b/tests/all.py<br>
> @@ -4407,6 +4407,7 @@ import_glsl_parser_tests(arb_derivative_control,<br>
>                           [''])<br>
><br>
>  spec['ARB_direct_state_access'] = {}<br>
> +spec['ARB_direct_state_access']['create-transformfeedbacks'] = PiglitGLTest(['arb_direct_state_access-create-transformfeedbacks'], run_concurrent=True)<br>
>  spec['ARB_direct_state_access']['dsa-textures'] = PiglitGLTest(['arb_direct_state_access-dsa-textures'], run_concurrent=True)<br>
>  spec['ARB_direct_state_access']['texturesubimage'] = PiglitGLTest(['arb_direct_state_access-texturesubimage'], run_concurrent=True)<br>
>  spec['ARB_direct_state_access']['bind-texture-unit'] = PiglitGLTest(['arb_direct_state_access-bind-texture-unit'], run_concurrent=True)<br>
> diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt<br>
> index 2cdce5d..3449cb1 100644<br>
> --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt<br>
> +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt<br>
> @@ -9,6 +9,7 @@ link_libraries (<br>
>       ${OPENGL_glu_LIBRARY}<br>
>  )<br>
><br>
> +piglit_add_executable (arb_direct_state_access-create-transformfeedbacks create-transformfeedbacks.c)<br>
>  piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c dsa-utils.c)<br>
>  piglit_add_executable (arb_direct_state_access-texturesubimage texturesubimage.c)<br>
>  piglit_add_executable (arb_direct_state_access-bind-texture-unit bind-texture-unit.c)<br>
> diff --git a/tests/spec/arb_direct_state_access/create-transformfeedbacks.c b/tests/spec/arb_direct_state_access/create-transformfeedbacks.c<br>
> new file mode 100644<br>
> index 0000000..1189cae<br>
> --- /dev/null<br>
> +++ b/tests/spec/arb_direct_state_access/create-transformfeedbacks.c<br>
> @@ -0,0 +1,75 @@<br>
> +/*<br>
> + * Copyright 2015 Intel Corporation<br>
> + *<br>
> + * Permission is hereby granted, free of charge, to any person obtaining a<br>
> + * copy of this software and associated documentation files (the "Software"),<br>
> + * to deal in the Software without restriction, including without limitation<br>
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
> + * and/or sell copies of the Software, and to permit persons to whom the<br>
> + * Software is furnished to do so, subject to the following conditions:<br>
> + *<br>
> + * The above copyright notice and this permission notice (including the next<br>
> + * paragraph) shall be included in all copies or substantial portions of the<br>
> + * Software.<br>
> + *<br>
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL<br>
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING<br>
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER<br>
> + * DEALINGS IN THE SOFTWARE.<br>
> + */<br>
> +<br>
> +/** @file create-transformfeedbacks.c<br>
> + *<br>
> + * Tests glCreateTransformFeedbacks to see if it behaves in the expected way,<br>
> + * throwing the correct errors, etc.<br>
> + */<br>
> +<br>
> +#include "piglit-util-gl.h"<br>
> +#include "dsa-utils.h"<br>
> +<br>
> +PIGLIT_GL_TEST_CONFIG_BEGIN<br>
> +<br>
> +     config.supports_gl_compat_version = 13;<br>
> +<br>
> +     config.window_visual = PIGLIT_GL_VISUAL_RGBA |<br>
> +             PIGLIT_GL_VISUAL_DOUBLE;<br>
> +<br>
> +PIGLIT_GL_TEST_CONFIG_END<br>
> +<br>
> +void<br>
> +piglit_init(int argc, char **argv)<br>
> +{<br>
> +     piglit_require_extension("GL_ARB_direct_state_access");<br>
> +     piglit_require_extension("GL_ARB_transform_feedback3");<br>
> +}<br>
> +<br>
> +enum piglit_result<br>
> +piglit_display(void)<br>
> +{<br>
> +     bool pass = true;<br>
> +     GLuint ids[10];<br>
> +<br>
> +     /* Throw some invalid inputs at glCreateTransformFeedbacks. */<br>
> +<br>
> +     /* n is negative */<br>
> +     glCreateTransformFeedbacks(-1, ids);<br>
> +     SUBTEST(GL_INVALID_VALUE, pass, "negative n");<br>
<br>
</div></div>I'd phrase this as "n < 0" to match the third subcase.<br>
<span class=""><br>
> +<br>
> +     /* Throw some valid inputs at glCreateTransformFeedbacks. */<br>
> +<br>
> +     /* n is zero */<br>
> +     glCreateTransformFeedbacks(0, NULL);<br>
> +     SUBTEST(GL_NO_ERROR, pass, "n is 0");<br>
<br>
</span>And I'd phrase this as "n == 0" to match...<br>
<div class="HOEnZb"><div class="h5"><br>
> +<br>
> +     /* n is more than 1 */<br>
> +     glCreateTransformFeedbacks(10, ids);<br>
> +     SUBTEST(GL_NO_ERROR, pass, "n > 1");<br>
> +<br>
> +     SUBTESTCONDITION(glIsTransformFeedback(ids[2]), pass,<br>
> +                     "IsTransformFeedback()");<br>
> +<br>
> +     return pass ? PIGLIT_PASS : PIGLIT_FAIL;<br>
> +}<br>
> diff --git a/tests/spec/arb_direct_state_access/dsa-utils.h b/tests/spec/arb_direct_state_access/dsa-utils.h<br>
> index a2f70b2..25b5524 100644<br>
> --- a/tests/spec/arb_direct_state_access/dsa-utils.h<br>
> +++ b/tests/spec/arb_direct_state_access/dsa-utils.h<br>
> @@ -39,6 +39,22 @@ extern "C" {<br>
><br>
>  #include "piglit-util-gl.h"<br>
><br>
> +#define SUBTEST(error, global, format, args...) \<br>
> +do { \<br>
> +     bool local = piglit_check_gl_error((error)); \<br>
> +     global = global && local; \<br>
> +     piglit_report_subtest_result(local ? PIGLIT_PASS : PIGLIT_FAIL, \<br>
> +                                  (format), ##args); \<br>
> +} while (0)<br>
> +<br>
> +#define SUBTESTCONDITION(condition, global, format, args...) \<br>
> +do { \<br>
> +     bool cond = (condition); \<br>
> +     global = global && cond; \<br>
> +     piglit_report_subtest_result(cond ? PIGLIT_PASS : PIGLIT_FAIL, \<br>
> +                                  (format), ##args); \<br>
> +} while (0)<br>
> +<br>
>  void dsa_init_program(void);<br>
><br>
>  void dsa_texture_with_unit(GLuint);<br>
><br>
<br>
</div></div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/piglit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</div></div></blockquote></div><br></div>