From: Jarkko Pöyry Date: Tue, 24 Mar 2015 20:34:36 +0000 (-0700) Subject: Add negative tests for array initialization. X-Git-Tag: upstream/0.1.0~1823^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cafd5f117a5193d45d75ee3ccdf52caded3d76ce;p=platform%2Fupstream%2FVK-GL-CTS.git Add negative tests for array initialization. - Rename constructor_c-styleN to constructor_c_styleN to avoid '-' character in test name. - Add some additional initialization tests. - Port initialization tests to GLES31. Bug: 19639781 Change-Id: Id9488837cc24c82c3ff1ad31c49da3a238c6fee8 --- diff --git a/data/gles3/shaders/arrays.test b/data/gles3/shaders/arrays.test index f627652..7b31d3c 100644 --- a/data/gles3/shaders/arrays.test +++ b/data/gles3/shaders/arrays.test @@ -1922,7 +1922,7 @@ group invalid "Invalid Functions" "" end - case constructor_c-style1 + case constructor_c_style1 version 300 es expect compile_fail @@ -1941,7 +1941,7 @@ group invalid "Invalid Functions" "" end - case constructor_c-style2 + case constructor_c_style2 version 300 es expect compile_fail @@ -1959,4 +1959,40 @@ group invalid "Invalid Functions" "" end + case constructor_c_style3 + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float a[] = float[3] { 1.0, 2.0, 3.0 }; + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case constructor_c_style4 + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float a[3] = { 1.0, 2.0, 3.0 }; + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + end # invalid diff --git a/data/gles31/shaders/arrays.test b/data/gles31/shaders/arrays.test new file mode 100644 index 0000000..51d1ab9 --- /dev/null +++ b/data/gles31/shaders/arrays.test @@ -0,0 +1,77 @@ + +group invalid "Invalid constructions" + + case constructor_c_style1 + version 310 es + expect compile_fail + + both "" + #version 310 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float a[]; + a = float[3] { 1.0, 2.0, 3.0 }; + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case constructor_c_style2 + version 310 es + expect compile_fail + + both "" + #version 310 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float a[5] = { 1.0, 2.0, 3.0 }; + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case constructor_c_style3 + version 310 es + expect compile_fail + + both "" + #version 310 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float a[] = float[3] { 1.0, 2.0, 3.0 }; + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case constructor_c_style4 + version 310 es + expect compile_fail + + both "" + #version 310 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float a[3] = { 1.0, 2.0, 3.0 }; + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # invalid diff --git a/modules/gles31/functional/es31fFunctionalTests.cpp b/modules/gles31/functional/es31fFunctionalTests.cpp index 3720cc0..5b99d2e 100644 --- a/modules/gles31/functional/es31fFunctionalTests.cpp +++ b/modules/gles31/functional/es31fFunctionalTests.cpp @@ -189,6 +189,7 @@ public: addChild(new ShaderMultisampleInterpolationTests(m_context)); addChild(new OpaqueTypeIndexingTests (m_context)); addChild(new ShaderLibraryTest (m_context, "functions", "Function Tests")); + addChild(new ShaderLibraryTest (m_context, "arrays", "Arrays Tests")); addChild(new ShaderLibraryTest (m_context, "arrays_of_arrays", "Arrays of Arrays Tests")); addChild(new ShaderLinkageTests (m_context)); addChild(new ShaderBuiltinConstantTests (m_context));