diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 17:42:43 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:36:02 +0200 |
commit | decaad001cf3eca4e1214327b7339c23dd70e5cc (patch) | |
tree | 9865a7aa6b4f1acde0874b6dbc120da497a85d50 | |
parent | a716a809a7467655a3fe4d47e35848cce37a4f88 (diff) |
Use do_run_from_file() for test_demangle_stacks
-rw-r--r-- | tests/core/test_demangle_stacks.in | 21 | ||||
-rw-r--r-- | tests/core/test_demangle_stacks.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 24 |
3 files changed, 25 insertions, 21 deletions
diff --git a/tests/core/test_demangle_stacks.in b/tests/core/test_demangle_stacks.in new file mode 100644 index 00000000..8db34832 --- /dev/null +++ b/tests/core/test_demangle_stacks.in @@ -0,0 +1,21 @@ + + #include<stdio.h> + #include<stdlib.h> + + namespace NameSpace { + class Class { + public: + int Aborter(double x, char y, int *z) { + int addr = x+y+(int)z; + void *p = (void*)addr; + for (int i = 0; i < 100; i++) free(p); // will abort, should show proper stack trace + } + }; + } + + int main(int argc, char **argv) { + NameSpace::Class c; + c.Aborter(1.234, 'a', NULL); + return 0; + } +
\ No newline at end of file diff --git a/tests/core/test_demangle_stacks.out b/tests/core/test_demangle_stacks.out new file mode 100644 index 00000000..d1c61b45 --- /dev/null +++ b/tests/core/test_demangle_stacks.out @@ -0,0 +1 @@ +NameSpace::Class::Aborter(double, char, int*)
\ No newline at end of file diff --git a/tests/test_core.py b/tests/test_core.py index 5d66c6d3..1dc26eb8 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -5360,28 +5360,10 @@ def process(filename): def test_demangle_stacks(self): if Settings.ASM_JS: return self.skip('spidermonkey has stack trace issues') - src = r''' - #include<stdio.h> - #include<stdlib.h> - - namespace NameSpace { - class Class { - public: - int Aborter(double x, char y, int *z) { - int addr = x+y+(int)z; - void *p = (void*)addr; - for (int i = 0; i < 100; i++) free(p); // will abort, should show proper stack trace - } - }; - } + test_path = path_from_root('tests', 'core', 'test_demangle_stacks') + src, output = (test_path + s for s in ('.in', '.out')) - int main(int argc, char **argv) { - NameSpace::Class c; - c.Aborter(1.234, 'a', NULL); - return 0; - } - ''' - self.do_run(src, 'NameSpace::Class::Aborter(double, char, int*)'); + self.do_run_from_file(src, output) def test_embind(self): if self.emcc_args is None: return self.skip('requires emcc') |