[Piglit] [PATCH V2 1/2] arb_texture_storage_multisample: add test for TexStorage*Multisample

Eric Anholt eric at anholt.net
Wed May 8 15:06:45 PDT 2013


Chris Forbes <chrisf at ijw.co.nz> writes:
> diff --git a/tests/spec/arb_texture_storage_multisample/tex-storage.c b/tests/spec/arb_texture_storage_multisample/tex-storage.c
> new file mode 100644
> index 0000000..815f591
> --- /dev/null
> +++ b/tests/spec/arb_texture_storage_multisample/tex-storage.c
> @@ -0,0 +1,141 @@
> +/*
> + * Copyright © 2013 Chris Forbes
> + *
> + * 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.
> + */
> +#include "piglit-util-gl-common.h"
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +
> +    config.supports_gl_compat_version = 30;
> +
> +    config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
> +
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +enum piglit_result
> +piglit_display(void)
> +{
> +    return PIGLIT_FAIL;
> +}

Style bits: piglit is 8-space tab indentation.

> +
> +static void
> +check_zero_texture(void)
> +{
> +    /* attempting to call TexStorage*Multisample on the zero texture
> +     * must fail with INVALID_OPERATION */

Closing comment goes on its own line.

> +    glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, 0);
> +    glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE,
> +            4, GL_RGBA8, 64, 64, GL_TRUE);

continuing lines should line up with the opening (

> +
> +    piglit_report_subtest_result(
> +            piglit_check_gl_error(GL_INVALID_OPERATION) ? PIGLIT_PASS : PIGLIT_FAIL,
> +            "zero-texture");
> +}

This seems super verbose.  I'm tempted to go make a util function for
reporting subtest results based on expected GL errors -- it would mean
easy improvements in granularity on various api-errors testss.

But it's fine as-is.  Functionally, this tests looks great.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20130508/566cb165/attachment.pgp>


More information about the Piglit mailing list