aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp/tests
diff options
context:
space:
mode:
authorCarl Worth <[email protected]>2012-11-28 11:52:05 -0800
committerCarl Worth <[email protected]>2012-11-29 13:03:01 -0800
commit907a10378e4c63686abe0739634b30615018ccd1 (patch)
treefe6584d0a6524eea4ae8c206a02f4aa359d5723f /src/glsl/glcpp/tests
parentdbd6135bc1ba285128ab991c03c4df6fbd6fefe8 (diff)
glcpp: Add support for __LINE__ and __FILE__ macros
These tokens are easy to expand by just looking at the current, tracked location values, (and no need to look anything up in the hash table). Add a test which verifies __LINE__ with several values, (and verifies __FILE__ for the single value of 0). Our testing framework isn't sophisticated enough here to have a test with multiple file inputs. This commit fixes part of es3conform's preprocess16_frag test. Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/glsl/glcpp/tests')
-rw-r--r--src/glsl/glcpp/tests/113-line-and-file-macros.c7
-rw-r--r--src/glsl/glcpp/tests/113-line-and-file-macros.c.expected8
2 files changed, 15 insertions, 0 deletions
diff --git a/src/glsl/glcpp/tests/113-line-and-file-macros.c b/src/glsl/glcpp/tests/113-line-and-file-macros.c
new file mode 100644
index 00000000000..369c4879260
--- /dev/null
+++ b/src/glsl/glcpp/tests/113-line-and-file-macros.c
@@ -0,0 +1,7 @@
+1. Number of dalmations: __LINE__ __FILE__ __LINE__
+2. Nominal visual acuity: __LINE__ __FILE__ / __LINE__ __FILE__
+3. Battle of Thermopylae, as film: __LINE__ __FILE__ __FILE__
+4. HTTP code for "Not Found": __LINE__ __FILE__ __LINE__
+5. Hexadecimal for 20560: __LINE__ __FILE__ __LINE__ __FILE__
+6: Zip code for Nortonville, KS: __LINE__ __LINE__ __FILE__ __LINE__ __FILE__
+7. James Bond, as a number: __FILE__ __FILE__ __LINE__
diff --git a/src/glsl/glcpp/tests/113-line-and-file-macros.c.expected b/src/glsl/glcpp/tests/113-line-and-file-macros.c.expected
new file mode 100644
index 00000000000..3562fb9eaad
--- /dev/null
+++ b/src/glsl/glcpp/tests/113-line-and-file-macros.c.expected
@@ -0,0 +1,8 @@
+1. Number of dalmations: 1 0 1
+2. Nominal visual acuity: 2 0 / 2 0
+3. Battle of Thermopylae, as film: 3 0 0
+4. HTTP code for "Not Found": 4 0 4
+5. Hexadecimal for 20560: 5 0 5 0
+6: Zip code for Nortonville, KS: 6 6 0 6 0
+7. James Bond, as a number: 0 0 7
+