Skip to content

Commit

Permalink
Added unit tests for preprocessor's macro concat operator.
Browse files Browse the repository at this point in the history
These fail at the moment.
  • Loading branch information
icculus committed Feb 24, 2010
1 parent 024580d commit 631b585
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 0 deletions.
@@ -0,0 +1 @@
RIGHT
@@ -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)

@@ -0,0 +1 @@
RIGHT
4 changes: 4 additions & 0 deletions unit_tests/preprocessor/output/concat-operator-multiple
@@ -0,0 +1,4 @@
/* This should produce "RIGHT" instead of "RI ## G ## HT" */
#define x(a,b) a##G##b
x(RI, HT)

@@ -0,0 +1 @@
RIGHT
@@ -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)

@@ -0,0 +1 @@
RIGHT

0 comments on commit 631b585

Please sign in to comment.