diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-03-14 15:59:58 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-03-14 15:59:58 -0700 |
commit | e45a4e5facabc667c74aaf41896ce6823b58992e (patch) | |
tree | 9ae4f4a814ee7eb69a09a0373fc9748be7fde4c6 /tests | |
parent | 808f868a44e20b2dc02cbfd10ade5d8cee6ff127 (diff) |
add strcat testing
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py index 575b9d91..78a83b3e 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -1898,13 +1898,23 @@ Succeeded! printf("waka %s\\n", three); } + { + char *one = "string number one top notch"; + char *two = "fa la sa ho fi FI FO FUM WHEN WHERE WHY HOW WHO"; + char three[1000]; + strcpy(three, &one[argc*2]); + strcat(three, &two[argc*3]); + printf("cat |%s|\\n", three); + } + return 0; } ''' for named in (0, 1): print named Settings.NAMED_GLOBALS = named - self.do_run(src, '4:10,177,543,def\n4\nwowie\ntoo\n76\n5\n(null)\n/* a comment */\n// another\ntest\nwaka ....e 1 O...wo 2 T................................\n', ['wowie', 'too', '74']) + self.do_run(src, '''4:10,177,543,def\n4\nwowie\ntoo\n76\n5\n(null)\n/* a comment */\n// another\ntest\nwaka ....e 1 O...wo 2 T................................ +cat |umber one top notchfi FI FO FUM WHEN WHERE WHY HOW WHO|''', ['wowie', 'too', '74']) if self.emcc_args == []: gen = open(self.in_dir('src.cpp.o.js')).read() assert ('var __str1;' in gen) == named |