mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
glcpp: Add test involving token pasting of INTEGER tokens.
This test file is very similar to test 113-line-and-file-macros but uses token pasting for cleaner quiz answers (without spaces between the digits). This test passes thanks to the recent addition of support for pasting INTEGER tokens, (but would have failed without that). (Note that this test is distinct from test 059-token-pasting-integer which pastes integers parsed from the source. Those are parsed to INTEGER_STRING tokens and are already pasted correctly as verified by that test. The only way to generate the INTEGER tokens which currently fail to paste is with an internal define such as __LINE__ that results in an integer.) Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
522d1ccd77
commit
89cd6df034
2 changed files with 15 additions and 0 deletions
7
src/glsl/glcpp/tests/114-paste-integer-tokens.c
Normal file
7
src/glsl/glcpp/tests/114-paste-integer-tokens.c
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#define PASTE3(a,b,c) a ## b ## c
|
||||
#define PASTE4(a,b,c,d) a ## b ## c ## d
|
||||
#define PASTE5(a,b,c,d,e) a ## b ## c ## d ## e
|
||||
4. HTTP code for "Not Found": PASTE3(__LINE__, __FILE__ , __LINE__)
|
||||
5. Hexadecimal for 20560: PASTE4(__LINE__, __FILE__, __LINE__, __FILE__)
|
||||
6: Zip code for Nortonville, KS: PASTE5(__LINE__, __LINE__, __FILE__, __LINE__, __FILE__)
|
||||
7. James Bond, as a number: PASTE3(__FILE__, __FILE__, __LINE__)
|
||||
8
src/glsl/glcpp/tests/114-paste-integer-tokens.c.expected
Normal file
8
src/glsl/glcpp/tests/114-paste-integer-tokens.c.expected
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
|
||||
|
||||
4. HTTP code for "Not Found": 404
|
||||
5. Hexadecimal for 20560: 5050
|
||||
6: Zip code for Nortonville, KS: 66060
|
||||
7. James Bond, as a number: 007
|
||||
|
||||
Loading…
Add table
Reference in a new issue