Add new tests that test more invalid identifiers.
Change-Id: I138283623a98c980790e392b64d434dab33f51d4
<Test name="missing_block_name_fragment">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
- <Test name="invalid_character_block_name_vertex">
+ <Test name="invalid_number_block_name_vertex">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
- <Test name="invalid_character_block_name_fragment">
+ <Test name="invalid_number_block_name_fragment">
+ <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+ </Test>
+ <Test name="invalid_hash_block_name_vertex">
+ <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+ </Test>
+ <Test name="invalid_hash_block_name_fragment">
+ <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+ </Test>
+ <Test name="invalid_dollar_block_name_vertex">
+ <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+ </Test>
+ <Test name="invalid_dollar_block_name_fragment">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
<Test name="invalid_identifier_block_name_vertex">
<Test name="too_long_block_name_fragment">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
- <Test name="invalid_character_instance_name_vertex">
+ <Test name="invalid_number_instance_name_vertex">
+ <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+ </Test>
+ <Test name="invalid_number_instance_name_fragment">
+ <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+ </Test>
+ <Test name="invalid_hash_instance_name_vertex">
+ <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+ </Test>
+ <Test name="invalid_hash_instance_name_fragment">
+ <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+ </Test>
+ <Test name="invalid_dollar_instance_name_vertex">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
- <Test name="invalid_character_instance_name_fragment">
+ <Test name="invalid_dollar_instance_name_fragment">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
<Test name="invalid_identifier_instance_name_vertex">
dEQP-GLES3.functional.shaders.uniform_block.invalid.member_layout_std140_fragment
dEQP-GLES3.functional.shaders.uniform_block.invalid.missing_block_name_vertex
dEQP-GLES3.functional.shaders.uniform_block.invalid.missing_block_name_fragment
-dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_character_block_name_vertex
-dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_character_block_name_fragment
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_number_block_name_vertex
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_number_block_name_fragment
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_hash_block_name_vertex
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_hash_block_name_fragment
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_dollar_block_name_vertex
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_dollar_block_name_fragment
dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_identifier_block_name_vertex
dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_identifier_block_name_fragment
dEQP-GLES3.functional.shaders.uniform_block.invalid.too_long_block_name_vertex
dEQP-GLES3.functional.shaders.uniform_block.invalid.too_long_block_name_fragment
-dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_character_instance_name_vertex
-dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_character_instance_name_fragment
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_number_instance_name_vertex
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_number_instance_name_fragment
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_hash_instance_name_vertex
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_hash_instance_name_fragment
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_dollar_instance_name_vertex
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_dollar_instance_name_fragment
dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_identifier_instance_name_vertex
dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_identifier_instance_name_fragment
dEQP-GLES3.functional.shaders.uniform_block.invalid.double_underscore_block_name_vertex
}
""
end
- case invalid_character_block_name_vertex
+ case invalid_number_block_name_vertex
version 300 es
expect compile_fail
}
""
end
- case invalid_character_block_name_fragment
+ case invalid_number_block_name_fragment
version 300 es
expect compile_fail
}
""
end
+ case invalid_hash_block_name_vertex
+ version 300 es
+ expect compile_fail
+
+ vertex ""
+ #version 300 es
+ precision highp float;
+
+
+
+ uniform #UniformBlock
+ {
+ vec4 uniformMember;
+ } uniformBlock;
+
+ void main()
+ {
+ gl_Position = uniformBlock.uniformMember;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision highp float;
+
+ layout(location=0) out vec4 o_color;
+
+ void main()
+ {
+ o_color = vec4(1.0);
+ }
+ ""
+ end
+ case invalid_hash_block_name_fragment
+ version 300 es
+ expect compile_fail
+
+ vertex ""
+ #version 300 es
+ precision highp float;
+
+ in vec4 a_pos;
+
+ void main()
+ {
+ gl_Position = a_pos;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision highp float;
+
+ layout(location=0) out vec4 o_color;
+
+ uniform #UniformBlock
+ {
+ vec4 uniformMember;
+ } uniformBlock;
+
+ void main()
+ {
+ o_color = uniformBlock.uniformMember;
+ }
+ ""
+ end
+ case invalid_dollar_block_name_vertex
+ version 300 es
+ expect compile_fail
+
+ vertex ""
+ #version 300 es
+ precision highp float;
+
+
+
+ uniform $UniformBlock
+ {
+ vec4 uniformMember;
+ } uniformBlock;
+
+ void main()
+ {
+ gl_Position = uniformBlock.uniformMember;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision highp float;
+
+ layout(location=0) out vec4 o_color;
+
+ void main()
+ {
+ o_color = vec4(1.0);
+ }
+ ""
+ end
+ case invalid_dollar_block_name_fragment
+ version 300 es
+ expect compile_fail
+
+ vertex ""
+ #version 300 es
+ precision highp float;
+
+ in vec4 a_pos;
+
+ void main()
+ {
+ gl_Position = a_pos;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision highp float;
+
+ layout(location=0) out vec4 o_color;
+
+ uniform $UniformBlock
+ {
+ vec4 uniformMember;
+ } uniformBlock;
+
+ void main()
+ {
+ o_color = uniformBlock.uniformMember;
+ }
+ ""
+ end
case invalid_identifier_block_name_vertex
version 300 es
expect compile_fail
}
""
end
- case invalid_character_instance_name_vertex
+ case invalid_number_instance_name_vertex
version 300 es
expect compile_fail
}
""
end
- case invalid_character_instance_name_fragment
+ case invalid_number_instance_name_fragment
version 300 es
expect compile_fail
}
""
end
+ case invalid_hash_instance_name_vertex
+ version 300 es
+ expect compile_fail
+
+ vertex ""
+ #version 300 es
+ precision highp float;
+
+
+
+ uniform UniformInstance
+ {
+ vec4 uniformMember;
+ } $uniformBlock;
+
+ void main()
+ {
+ gl_Position = $uniformBlock.uniformMember;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision highp float;
+
+ layout(location=0) out vec4 o_color;
+
+ void main()
+ {
+ o_color = vec4(1.0);
+ }
+ ""
+ end
+ case invalid_hash_instance_name_fragment
+ version 300 es
+ expect compile_fail
+
+ vertex ""
+ #version 300 es
+ precision highp float;
+
+ in vec4 a_pos;
+
+ void main()
+ {
+ gl_Position = a_pos;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision highp float;
+
+ layout(location=0) out vec4 o_color;
+
+ uniform UniformInstance
+ {
+ vec4 uniformMember;
+ } $uniformBlock;
+
+ void main()
+ {
+ o_color = $uniformBlock.uniformMember;
+ }
+ ""
+ end
+ case invalid_dollar_instance_name_vertex
+ version 300 es
+ expect compile_fail
+
+ vertex ""
+ #version 300 es
+ precision highp float;
+
+
+
+ uniform UniformInstance
+ {
+ vec4 uniformMember;
+ } $uniformBlock;
+
+ void main()
+ {
+ gl_Position = $uniformBlock.uniformMember;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision highp float;
+
+ layout(location=0) out vec4 o_color;
+
+ void main()
+ {
+ o_color = vec4(1.0);
+ }
+ ""
+ end
+ case invalid_dollar_instance_name_fragment
+ version 300 es
+ expect compile_fail
+
+ vertex ""
+ #version 300 es
+ precision highp float;
+
+ in vec4 a_pos;
+
+ void main()
+ {
+ gl_Position = a_pos;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision highp float;
+
+ layout(location=0) out vec4 o_color;
+
+ uniform UniformInstance
+ {
+ vec4 uniformMember;
+ } $uniformBlock;
+
+ void main()
+ {
+ o_color = $uniformBlock.uniformMember;
+ }
+ ""
+ end
case invalid_identifier_instance_name_vertex
version 300 es
expect compile_fail
${{OUTPUT}} = uniformBlock.uniformMember;
}"""[1:]
-invalidCharacterBlockNameShaderTemplate = """
+invalidNumberBlockNameShaderTemplate = """
#version 300 es
precision highp float;
${{OUTPUT}} = uniformBlock.uniformMember;
}"""[1:]
+invalidHashBlockNameShaderTemplate = """
+#version 300 es
+precision highp float;
+
+${{OUTPUT_DECLARATION}}
+
+uniform #UniformBlock
+{
+ vec4 uniformMember;
+} uniformBlock;
+
+void main()
+{
+ ${{OUTPUT}} = uniformBlock.uniformMember;
+}"""[1:]
+
+invalidDollarBlockNameShaderTemplate = """
+#version 300 es
+precision highp float;
+
+${{OUTPUT_DECLARATION}}
+
+uniform $UniformBlock
+{
+ vec4 uniformMember;
+} uniformBlock;
+
+void main()
+{
+ ${{OUTPUT}} = uniformBlock.uniformMember;
+}"""[1:]
+
invalidIdentifierBlockNameShaderTemplate = """
#version 300 es
precision highp float;
${{OUTPUT}} = uniformBlock.uniformMember;
}""")[1:]
-invalidCharacterInstanceNameShaderTemplate = """
+invalidNumberInstanceNameShaderTemplate = """
#version 300 es
precision highp float;
${{OUTPUT}} = 0uniformBlock.uniformMember;
}"""[1:]
+invalidHashInstanceNameShaderTemplate = """
+#version 300 es
+precision highp float;
+
+${{OUTPUT_DECLARATION}}
+
+uniform UniformInstance
+{
+ vec4 uniformMember;
+} #uniformBlock;
+
+void main()
+{
+ ${{OUTPUT}} = #uniformBlock.uniformMember;
+}"""[1:]
+
+invalidDollarInstanceNameShaderTemplate = """
+#version 300 es
+precision highp float;
+
+${{OUTPUT_DECLARATION}}
+
+uniform UniformInstance
+{
+ vec4 uniformMember;
+} $uniformBlock;
+
+void main()
+{
+ ${{OUTPUT}} = $uniformBlock.uniformMember;
+}"""[1:]
+
invalidIdentifierInstanceNameShaderTemplate = """
#version 300 es
precision highp float;
+ sum([createCases("member_layout_%s" % qualifier, invalidMemberLayoutShaderTemplate % qualifier, False)
for qualifier in ["shared", "packed", "std140"]], [])
+ createCases("missing_block_name", missingBlockNameShaderTemplate, False)
- + createCases("invalid_character_block_name", invalidCharacterBlockNameShaderTemplate, False)
+ + createCases("invalid_number_block_name", invalidNumberBlockNameShaderTemplate, False)
+ + createCases("invalid_hash_block_name", invalidHashBlockNameShaderTemplate, False)
+ + createCases("invalid_dollar_block_name", invalidDollarBlockNameShaderTemplate, False)
+ createCases("invalid_identifier_block_name", invalidIdentifierBlockNameShaderTemplate, False)
+ createCases("too_long_block_name", tooLongIdentifierBlockNameShaderTemplate, False)
- + createCases("invalid_character_instance_name", invalidCharacterInstanceNameShaderTemplate, False)
+ + createCases("invalid_number_instance_name", invalidNumberInstanceNameShaderTemplate, False)
+ + createCases("invalid_hash_instance_name", invalidDollarInstanceNameShaderTemplate, False)
+ + createCases("invalid_dollar_instance_name", invalidDollarInstanceNameShaderTemplate, False)
+ createCases("invalid_identifier_instance_name", invalidIdentifierInstanceNameShaderTemplate, False)
+ createCases("double_underscore_block_name", doubleUnderscoreIdentifierBlockNameShaderTemplate, False)
+ createCases("double_underscore_instance_name", doubleUnderscoreIdentifierInstanceNameShaderTemplate, False)