Mesa (master): glcpp: Extend the invalid-paste test
Carl Worth
cworth at kemper.freedesktop.org
Thu Nov 29 21:08:12 UTC 2012
Module: Mesa
Branch: master
Commit: c86eb0cd65f04a242952bfc610d80341673b3d52
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c86eb0cd65f04a242952bfc610d80341673b3d52
Author: Carl Worth <cworth at cworth.org>
Date: Wed Nov 28 12:57:09 2012 -0800
glcpp: Extend the invalid-paste test
The current code lets a few invalid pastes through, such as an string pasted
onto the end of an integer. Extend the invalid-paste test to catch some of
these.
Reviewed-by: Matt Turner <mattst88 at gmail.com>
---
src/glsl/glcpp/tests/082-invalid-paste.c | 5 +++++
src/glsl/glcpp/tests/082-invalid-paste.c.expected | 15 +++++++++++++++
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/src/glsl/glcpp/tests/082-invalid-paste.c b/src/glsl/glcpp/tests/082-invalid-paste.c
index 40bf644..8b84d50 100644
--- a/src/glsl/glcpp/tests/082-invalid-paste.c
+++ b/src/glsl/glcpp/tests/082-invalid-paste.c
@@ -1,2 +1,7 @@
#define PASTE(x,y) x ## y
PASTE(<,>)
+PASTE(0,abc)
+PASTE(1,=)
+PASTE(2,@)
+PASTE(3,-4)
+PASTE(4,+5.2)
diff --git a/src/glsl/glcpp/tests/082-invalid-paste.c.expected b/src/glsl/glcpp/tests/082-invalid-paste.c.expected
index 2c92440..2dd21c0 100644
--- a/src/glsl/glcpp/tests/082-invalid-paste.c.expected
+++ b/src/glsl/glcpp/tests/082-invalid-paste.c.expected
@@ -1,5 +1,20 @@
0:2(7): preprocessor error:
Pasting "<" and ">" does not give a valid preprocessing token.
+0:3(7): preprocessor error:
+Pasting "0" and "abc" does not give a valid preprocessing token.
+0:4(7): preprocessor error:
+Pasting "1" and "=" does not give a valid preprocessing token.
+0:5(7): preprocessor error:
+Pasting "2" and "@" does not give a valid preprocessing token.
+0:6(7): preprocessor error:
+Pasting "3" and "-" does not give a valid preprocessing token.
+0:7(7): preprocessor error:
+Pasting "4" and "+" does not give a valid preprocessing token.
<
+0
+1
+2
+34
+45.2
More information about the mesa-commit
mailing list