aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/core/test_demangle_stacks.in21
-rw-r--r--tests/core/test_demangle_stacks.out1
-rw-r--r--tests/test_core.py24
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')