[Piglit] [PATCH 4/4] glsl-es-3.00: Add UTF-8 related tests

Ian Romanick idr at freedesktop.org
Sat Nov 17 17:08:53 PST 2012


From: Ian Romanick <ian.d.romanick at intel.com>

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 tests/spec/glsl-es-3.00/compiler/utf8-comment.vert | 68 ++++++++++++++++++++++
 .../spec/glsl-es-3.00/compiler/utf8-function.vert  | 22 +++++++
 .../glsl-es-3.00/compiler/utf8-identifier.vert     | 18 ++++++
 3 files changed, 108 insertions(+)
 create mode 100644 tests/spec/glsl-es-3.00/compiler/utf8-comment.vert
 create mode 100644 tests/spec/glsl-es-3.00/compiler/utf8-function.vert
 create mode 100644 tests/spec/glsl-es-3.00/compiler/utf8-identifier.vert

diff --git a/tests/spec/glsl-es-3.00/compiler/utf8-comment.vert b/tests/spec/glsl-es-3.00/compiler/utf8-comment.vert
new file mode 100644
index 0000000..813d895
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/utf8-comment.vert
@@ -0,0 +1,68 @@
+#version 300 es
+
+/* [config]
+ * expect_result: pass
+ * glsl_version: 3.00
+ * [end config]
+ *
+ * Page 8 (page 14 of the PDF) of the OpenGL ES Shading Language 3.00 spec
+ * says:
+ *
+ *     "Inside comments, the character set is extended to allow any byte
+ *     values to be used but with the exception that a byte with the value
+ *     zero is always interpreted as the end of the string. The character
+ *     encoding is assumed to be UTF-8 but no checking is performed for
+ *     invalid characters."
+ */
+
+// This is all of the UTF8 HTML entities listed at
+// http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
+
+// " & '
+// < >
+//   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+// ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+// À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+// Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+// à á â ã ä å æ ç è é ê ë ì í î ï
+// ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+// Œ œ
+// Š š
+// Ÿ
+// ƒ
+// ˆ ˜
+// Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο
+// Π Ρ Σ Τ Υ Φ Χ Ψ Ω Ϊ Ϋ ά έ ή ί
+// α β γ δ ε ζ η θ ι κ λ μ ν ξ ο
+// π ρ ς σ τ υ φ χ ψ ω
+// ϑ ϒ ϖ
+// – — ‘ ’ ‚ “ ” „
+// † ‡ • …
+// ‰ ′ ″ ‹ › ‾
+// ⁄
+// €
+// ℑ ℘ ℜ
+// ™
+// ℵ
+// ← ↑ → ↓ ↔
+// ↵
+// ⇐ ⇑ ⇒ ⇓ ⇔
+// ∀ ∂ ∃ ∅ ∇ ∈ ∉ ∋ ∏
+// ∑ − ∗ √ ∝ ∞
+// ∠ ∧ ∨ ∩ ∪ ∫
+// ∼
+// ≅ ≈
+// ≠ ≡ ≤ ≥
+// ⊂ ⊃ ⊄ ⊆ ⊇
+// ⊕ ⊗
+// ⊥
+// ⋅
+// ⌈ ⌉ ⌊ ⌋
+// 〈 〉
+// ◊
+// ♠ ♣ ♥ ♦
+
+void main()
+{
+  gl_Position = vec4(0.);
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/utf8-function.vert b/tests/spec/glsl-es-3.00/compiler/utf8-function.vert
new file mode 100644
index 0000000..c348ba6
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/utf8-function.vert
@@ -0,0 +1,22 @@
+#version 300 es
+
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.00
+ * [end config]
+ *
+ * While UTF-8 is allowed inside comments, sections 3.1 and 3.8 of the OpenGL
+ * ES Shading Language 3.00 spec say that only ASCII characters are allowed
+ * elsewhere.
+ */
+
+uniform float foo;
+
+float föö(void)
+{
+  return foo;
+}
+void main()
+{
+  gl_Position = vec4(föö());
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/utf8-identifier.vert b/tests/spec/glsl-es-3.00/compiler/utf8-identifier.vert
new file mode 100644
index 0000000..3cdfe3d
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/utf8-identifier.vert
@@ -0,0 +1,18 @@
+#version 300 es
+
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.00
+ * [end config]
+ *
+ * While UTF-8 is allowed inside comments, sections 3.1 and 3.8 of the OpenGL
+ * ES Shading Language 3.00 spec say that only ASCII characters are allowed
+ * elsewhere.
+ */
+
+uniform float föö;
+
+void main()
+{
+  gl_Position = vec4(föö);
+}
-- 
1.7.11.7



More information about the Piglit mailing list