aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjulien.hamaide <julien.hamaide@fishingcactus.com>2012-01-29 22:04:55 +0100
committerjulien.hamaide <julien.hamaide@fishingcactus.com>2012-01-29 22:04:55 +0100
commitfabc7c37d739a5be83acde3f762777ed4ba4c1f5 (patch)
treec17d5172f2ba2967100a072c6d64724c31f360f4
parent86240efbd5b655de6111b20852fda14863ac88f3 (diff)
Test string constant when passed as char(&)[] variable
-rwxr-xr-xtests/runner.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index f92793d4..e8b1e5ef 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -3617,6 +3617,22 @@ def process(filename):
'''
self.do_run(src, re.sub('(^|\n)\s+', '\\1', expected), post_build=add_pre_run_and_checks)
+ def test_direct_string_constant_usage(self):
+ src = '''
+ #include <iostream>
+ template<int i>
+ void printText( const char (&text)[ i ] )
+ {
+ std::cout << text;
+ }
+ int main()
+ {
+ printText( "some string constant" );
+ return 0;
+ }
+ '''
+ self.do_run(src, "some string constant")
+
def test_fs_base(self):
Settings.INCLUDE_FULL_LIBRARY = 1
try: