diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-06-29 18:37:05 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-07-03 15:31:04 -0700 |
commit | 1d043dddf1d99cffde43bf7005175c55771d73e8 (patch) | |
tree | 0b8f9d50ff347ac36453df9636da3d2c85f13e50 | |
parent | 0a77a104d3fa7aceeab1e642c4dc07697dc1a234 (diff) |
testing for linking with malloc
-rwxr-xr-x | tests/runner.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/runner.py b/tests/runner.py index 32bfd8ac..7f772d07 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -10700,9 +10700,8 @@ f.close() Class::Class(const char *name) { printf("new %s\n", name); } ''', ['new main\n']) - return # TODO - - test('clibs', r''' + # malloc usage in both modules + test('malloc', r''' #include <stdlib.h> #include <string.h> char *side(const char *data); @@ -10721,15 +10720,16 @@ f.close() #include "header.h" char *side(const char *data) { return (char*)data; -// char *ret = (char*)malloc(strlen(data)+1); - // strcpy(ret, data); - // return ret; + char *ret = (char*)malloc(strlen(data)+1); + strcpy(ret, data); + return ret; } ''', ['hello through side\n']) - return - # C library usage - test('clibs', r''' + return # TODO + + # iostream usage in one and std::string in both + test('iostream', r''' #include <iostream> #include <string> std::string side(); |