From 89cd6df03481dcf0dae948878ad1f77c819b442d Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 28 Nov 2012 17:32:03 -0800 Subject: [PATCH] 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 --- src/glsl/glcpp/tests/114-paste-integer-tokens.c | 7 +++++++ src/glsl/glcpp/tests/114-paste-integer-tokens.c.expected | 8 ++++++++ 2 files changed, 15 insertions(+) create mode 100644 src/glsl/glcpp/tests/114-paste-integer-tokens.c create mode 100644 src/glsl/glcpp/tests/114-paste-integer-tokens.c.expected diff --git a/src/glsl/glcpp/tests/114-paste-integer-tokens.c b/src/glsl/glcpp/tests/114-paste-integer-tokens.c new file mode 100644 index 00000000000..d80d9c7ef4b --- /dev/null +++ b/src/glsl/glcpp/tests/114-paste-integer-tokens.c @@ -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__) diff --git a/src/glsl/glcpp/tests/114-paste-integer-tokens.c.expected b/src/glsl/glcpp/tests/114-paste-integer-tokens.c.expected new file mode 100644 index 00000000000..a3ad7da596d --- /dev/null +++ b/src/glsl/glcpp/tests/114-paste-integer-tokens.c.expected @@ -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 + -- 2.30.2