From 362209c188896944827b9d9d60d0cfe9f7dd7096 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 1 Sep 2010 19:43:19 -0700 Subject: [PATCH] Add more structure constructor tests. --- tests/glslparser.tests | 3 +++ tests/glslparsertest/glsl2/constructor-25.vert | 7 +++++++ tests/glslparsertest/glsl2/constructor-26.vert | 8 ++++++++ tests/glslparsertest/glsl2/constructor-27.vert | 7 +++++++ 4 files changed, 25 insertions(+) create mode 100644 tests/glslparsertest/glsl2/constructor-25.vert create mode 100644 tests/glslparsertest/glsl2/constructor-26.vert create mode 100644 tests/glslparsertest/glsl2/constructor-27.vert diff --git a/tests/glslparser.tests b/tests/glslparser.tests index 4de5d279f..bed3c4ce9 100644 --- a/tests/glslparser.tests +++ b/tests/glslparser.tests @@ -255,6 +255,9 @@ add_otherglslparsertest('glsl2/constructor-21.vert', 'pass', '1.20') add_otherglslparsertest('glsl2/constructor-22.vert', 'pass', '1.20') add_otherglslparsertest('glsl2/constructor-23.vert', 'pass', '1.20') add_otherglslparsertest('glsl2/constructor-24.vert', 'pass', '1.20') +add_otherglslparsertest('glsl2/constructor-25.vert', 'fail') +add_otherglslparsertest('glsl2/constructor-26.vert', 'pass', '1.20') +add_otherglslparsertest('glsl2/constructor-27.vert', 'fail') add_otherglslparsertest('glsl2/const-array-01.frag', 'pass', '1.20') add_otherglslparsertest('glsl2/const-array-02.frag', 'pass', '1.20') add_otherglslparsertest('glsl2/const-array-03.frag', 'pass', '1.20') diff --git a/tests/glslparsertest/glsl2/constructor-25.vert b/tests/glslparsertest/glsl2/constructor-25.vert new file mode 100644 index 000000000..6a6830c33 --- /dev/null +++ b/tests/glslparsertest/glsl2/constructor-25.vert @@ -0,0 +1,7 @@ +/* FAIL - implicit conversions are not allowed in GLSL 1.10 */ +struct s { float f; }; + +void main() +{ + s t = s(1); +} diff --git a/tests/glslparsertest/glsl2/constructor-26.vert b/tests/glslparsertest/glsl2/constructor-26.vert new file mode 100644 index 000000000..a0c6867d3 --- /dev/null +++ b/tests/glslparsertest/glsl2/constructor-26.vert @@ -0,0 +1,8 @@ +/* PASS */ +#version 120 +struct s { float f; }; + +void main() +{ + s t = s(1); // an implicit conversion should happen here +} diff --git a/tests/glslparsertest/glsl2/constructor-27.vert b/tests/glslparsertest/glsl2/constructor-27.vert new file mode 100644 index 000000000..3a02c5fc1 --- /dev/null +++ b/tests/glslparsertest/glsl2/constructor-27.vert @@ -0,0 +1,7 @@ +/* FAIL - too many parameters given to structure constructor */ +struct s { float f; }; + +void main() +{ + s t = s(1.0, 2.0); +} -- 2.11.4.GIT