diff options
author | max99x <max99x@gmail.com> | 2011-08-27 08:09:49 +0300 |
---|---|---|
committer | max99x <max99x@gmail.com> | 2011-08-27 08:09:49 +0300 |
commit | c105c7232c06a47e8a801d1d122adcccb1a6e3f0 (patch) | |
tree | 79abc535798502dec5f9d1458feb3349e66e58ec /tests/runner.py | |
parent | 1ca0ab32d47326d0d83ae15165bf306cb9965658 (diff) |
Simplified strdup(); added test for it in test_strings.
Diffstat (limited to 'tests/runner.py')
-rw-r--r-- | tests/runner.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py index 8fd090f0..9b7c8ec9 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -679,10 +679,15 @@ if 'benchmark' not in sys.argv: printf("%s\\n", NULL); // Should print '(null)', not the string at address 0, which is a real address for us! printf("/* a comment */\\n"); // Should not break the generated code! printf("// another\\n"); // Should not break the generated code! + + char* strdup_val = strdup("test"); + printf("%s\\n", strdup_val); + free(strdup_val); + return 0; } ''' - self.do_test(src, '3:10,177,543\n4\nwowie\ntoo\n76\n5\n(null)\n/* a comment */\n// another', ['wowie', 'too', '74']) + self.do_test(src, '3:10,177,543\n4\nwowie\ntoo\n76\n5\n(null)\n/* a comment */\n// another\ntest\n', ['wowie', 'too', '74']) def test_error(self): src = r''' |