Added unit tests for preprocessor's macro concat operator.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 24 Feb 2010 13:18:50 -0500
changeset 863 929ec7cd03e0
parent 862 76b8bd7c347f
child 864 aa3bec973a21
Added unit tests for preprocessor's macro concat operator. These fail at the moment.
unit_tests/preprocessor/output/concat-operator-basic.correct
unit_tests/preprocessor/output/concat-operator-define-override
unit_tests/preprocessor/output/concat-operator-define-override.correct
unit_tests/preprocessor/output/concat-operator-multiple
unit_tests/preprocessor/output/concat-operator-multiple.correct
unit_tests/preprocessor/output/concat-operator-stacked-override
unit_tests/preprocessor/output/concat-operator-stacked-override.correct
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/unit_tests/preprocessor/output/concat-operator-basic.correct	Wed Feb 24 13:18:50 2010 -0500
@@ -0,0 +1,1 @@
+RIGHT
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/unit_tests/preprocessor/output/concat-operator-define-override	Wed Feb 24 13:18:50 2010 -0500
@@ -0,0 +1,6 @@
+// This should produce "RIGHT" and not "WRONG"
+#define RI WR
+#define GHT ONG
+#define REPLACE(RI, GHT) RI##GHT
+REPLACE(RI, GHT)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/unit_tests/preprocessor/output/concat-operator-define-override.correct	Wed Feb 24 13:18:50 2010 -0500
@@ -0,0 +1,1 @@
+RIGHT
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/unit_tests/preprocessor/output/concat-operator-multiple	Wed Feb 24 13:18:50 2010 -0500
@@ -0,0 +1,4 @@
+/* This should produce "RIGHT" instead of "RI ## G ## HT" */
+#define x(a,b) a##G##b
+x(RI, HT)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/unit_tests/preprocessor/output/concat-operator-multiple.correct	Wed Feb 24 13:18:50 2010 -0500
@@ -0,0 +1,1 @@
+RIGHT
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/unit_tests/preprocessor/output/concat-operator-stacked-override	Wed Feb 24 13:18:50 2010 -0500
@@ -0,0 +1,7 @@
+// This should produce "RIGHT" and not "WRONG"
+#define WR RI
+#define ONG GHT
+#define REPLACE(WR, ONG) WR##ONG
+#define REPLACE2(WR, ONG) REPLACE(WR, ONG)
+REPLACE2(WR, ONG)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/unit_tests/preprocessor/output/concat-operator-stacked-override.correct	Wed Feb 24 13:18:50 2010 -0500
@@ -0,0 +1,1 @@
+RIGHT
\ No newline at end of file