From 7e3ed40200ac87c50b84f73409ca0df48fc6a25d Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 11 Mar 2010 14:46:19 -0800 Subject: [PATCH] Add a handful of simple tests for function calls in constructors --- tests/constructor-01.glsl | 4 ++++ tests/function-01.glsl | 16 ++++++++++++++++ tests/function-02.glsl | 16 ++++++++++++++++ tests/function-03.glsl | 16 ++++++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 tests/constructor-01.glsl create mode 100644 tests/function-01.glsl create mode 100644 tests/function-02.glsl create mode 100644 tests/function-03.glsl diff --git a/tests/constructor-01.glsl b/tests/constructor-01.glsl new file mode 100644 index 00000000000..f7af569c683 --- /dev/null +++ b/tests/constructor-01.glsl @@ -0,0 +1,4 @@ +void main() +{ + gl_Position = vec4(1.0, 1.0, 1.0, 0.0);; +} diff --git a/tests/function-01.glsl b/tests/function-01.glsl new file mode 100644 index 00000000000..0eaa2397ab6 --- /dev/null +++ b/tests/function-01.glsl @@ -0,0 +1,16 @@ +/* FAIL - no function named 'foo' exists */ + +vec4 bar(float x, float y, float z, float w) +{ + vec4 v; + v.x = x; + v.y = y; + v.z = z; + v.w = w; + return v; +} + +void main() +{ + gl_Position = foo(1.0, 1.0, 1.0, 0.0); +} diff --git a/tests/function-02.glsl b/tests/function-02.glsl new file mode 100644 index 00000000000..941fcc1ef7b --- /dev/null +++ b/tests/function-02.glsl @@ -0,0 +1,16 @@ +/* FAIL - no version of 'foo' matches the call to 'foo' */ + +vec4 foo(float x, float y, float z, float w) +{ + vec4 v; + v.x = x; + v.y = y; + v.z = z; + v.w = w; + return v; +} + +void main() +{ + gl_Position = foo(1.0, 1.0, 1.0); +} diff --git a/tests/function-03.glsl b/tests/function-03.glsl new file mode 100644 index 00000000000..6f6562ea858 --- /dev/null +++ b/tests/function-03.glsl @@ -0,0 +1,16 @@ +/* PASS */ + +vec4 foo(float x, float y, float z, float w) +{ + vec4 v; + v.x = x; + v.y = y; + v.z = z; + v.w = w; + return v; +} + +void main() +{ + gl_Position = foo(1.0, 1.0, 1.0, 0.0); +} -- 2.30.2