[Piglit] [PATCH 7/8] util: fix piglit-shader for GLES1
Ian Romanick
idr at freedesktop.org
Sun Sep 4 17:30:09 PDT 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 09/03/2011 09:29 AM, Chia-I Wu wrote:
> Add stubs that simply assert that they should never be reached.
> ---
> tests/util/piglit-shader-gles1.c | 46 ++++++++++++++++++++++++++++++++++++++
> tests/util/piglit-shader.h | 45 ++++++++++++++++++++++++++++++++++++-
> 2 files changed, 90 insertions(+), 1 deletions(-)
> create mode 100644 tests/util/piglit-shader-gles1.c
>
> diff --git a/tests/util/piglit-shader-gles1.c b/tests/util/piglit-shader-gles1.c
> new file mode 100644
> index 0000000..76a1f4e
> --- /dev/null
> +++ b/tests/util/piglit-shader-gles1.c
> @@ -0,0 +1,46 @@
> +/*
> + * Copyright © 2011 LunarG, Inc.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> + * DEALINGS IN THE SOFTWARE.
> + */
> +
> +#ifndef USE_OPENGL_ES1
> +# error USE_OPENGL_ES1 is undefined
> +#endif
> +
> +#include "piglit-util.h"
> +
> +void
> +piglit_require_GLSL(void)
> +{
> + assert(!"GLSL does not exist in ES1");
> +}
> +
> +void
> +piglit_require_vertex_shader(void)
> +{
> + assert(!"vertex shader does not exist in ES1");
> +}
> +
> +void
> +piglit_require_fragment_shader(void)
> +{
> + assert(!"fragment shader does not exist in ES1");
> +}
The rest is fine, but I think the bodies of all these functions should
just be piglit_report_result(PIGLIT_SKIP). If one of these tests
accidentally gets built or run with GLES1, nobody will waste time
tracking down a skip result. They might waste time tracking down a
crash result...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAk5kGBAACgkQX1gOwKyEAw+yrQCbB/oyRzOwzDsj8bC8UQZC5wzr
7QYAoJ6c9VaWN8OFAw1D/QRD5AUqj4/J
=WgaL
-----END PGP SIGNATURE-----
More information about the Piglit
mailing list