diff options
author | Tom Fairfield <fairfieldt@gameclosure.com> | 2013-05-02 21:34:20 -0300 |
---|---|---|
committer | Tom Fairfield <fairfieldt@gameclosure.com> | 2013-05-02 21:39:32 -0300 |
commit | 4bdc1b05e88e5eb51695a3325d07577d8fda46ed (patch) | |
tree | 057164a0fe84d4912d6363b9de92847f65f47b7b /tests | |
parent | 0fb5e1babc151af00b94c61c3cc5a080d3053d1f (diff) |
fixes strcat so that it returns the correct value
It should return the "dest" pointer that was passed in.
test_strings has been updated with a test for the correct behavior.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/runner.py b/tests/runner.py index b3f88ea0..5a53c059 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -2051,8 +2051,9 @@ Succeeded! 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]); + char *four = strcat(three, &two[argc*3]); printf("cat |%s|\\n", three); + printf("returned |%s|\\n", four); } return 0; @@ -2062,7 +2063,8 @@ Succeeded! 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................................ -cat |umber one top notchfi FI FO FUM WHEN WHERE WHY HOW WHO|''', ['wowie', 'too', '74']) +cat |umber one top notchfi FI FO FUM WHEN WHERE WHY HOW WHO| +returned |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 |