Add test case for string literal concatenation.
This commit is contained in:
parent
ce27dd3aee
commit
bbb893f39e
|
@ -0,0 +1,12 @@
|
||||||
|
#define __STRINGIFY(x) #x
|
||||||
|
#define TEST_STRINGIFY(x) __STRINGIFY(x)
|
||||||
|
|
||||||
|
#define TEST_VERSION_MAJOR 6
|
||||||
|
#define TEST_VERSION_MINOR 0
|
||||||
|
#define TEST_VERSION_BUGFIX 0
|
||||||
|
|
||||||
|
#define TEST_VERSION_STR \
|
||||||
|
TEST_STRINGIFY(TEST_VERSION_MAJOR) \
|
||||||
|
"." TEST_STRINGIFY(TEST_VERSION_MINOR) "." TEST_STRINGIFY(TEST_VERSION_BUGFIX)
|
||||||
|
|
||||||
|
// TEST_VERSION_STR "6" "." "0" "." "0"
|
|
@ -80,4 +80,8 @@ foreach lang : ['c', 'cpp']
|
||||||
have = cc.get_define('MESON_TEST_ISSUE_1665')
|
have = cc.get_define('MESON_TEST_ISSUE_1665')
|
||||||
assert(have == '1', 'MESON_TEST_ISSUE_1665 value is "@0@" instead of "1"'.format(have))
|
assert(have == '1', 'MESON_TEST_ISSUE_1665 value is "@0@" instead of "1"'.format(have))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
have = cc.get_define('TEST_VERSION_STR',
|
||||||
|
prefix : '#include <concat.h>', include_directories: include_directories('.'))
|
||||||
|
assert(have == '"6.0.0"', 'TEST_VERSION_STR value is "@0@" instead of ""6.0.0""'.format(have))
|
||||||
endforeach
|
endforeach
|
||||||
|
|
Loading…
Reference in New Issue