summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 11:50:50 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:54 +0200
commitf45fab9e459a39b06383f3029078c7977f21aa8b (patch)
tree3ee80e03f5fa4d5093ea8524a3ee28aca107c52a
parent5b3a08da267f4b8bbdf66574dff5dc8066f99691 (diff)
Use do_run_from_file() for test_dynamic_cast_2
-rw-r--r--tests/core/test_dynamic_cast_2.in12
-rw-r--r--tests/core/test_dynamic_cast_2.out1
-rw-r--r--tests/test_core.py15
3 files changed, 16 insertions, 12 deletions
diff --git a/tests/core/test_dynamic_cast_2.in b/tests/core/test_dynamic_cast_2.in
new file mode 100644
index 00000000..6da4cade
--- /dev/null
+++ b/tests/core/test_dynamic_cast_2.in
@@ -0,0 +1,12 @@
+
+ #include <stdio.h>
+ #include <typeinfo>
+
+ class Class {};
+
+ int main() {
+ const Class* dp = dynamic_cast<const Class*>(&typeid(Class));
+ // should return dp == NULL,
+ printf("pointer: %p\n", dp);
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_dynamic_cast_2.out b/tests/core/test_dynamic_cast_2.out
new file mode 100644
index 00000000..be38bbcc
--- /dev/null
+++ b/tests/core/test_dynamic_cast_2.out
@@ -0,0 +1 @@
+pointer: (nil) \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index 75706525..f6852b0a 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1514,19 +1514,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
def test_dynamic_cast_2(self):
if self.emcc_args is None: return self.skip('need libcxxabi')
- src = r'''
- #include <stdio.h>
- #include <typeinfo>
-
- class Class {};
+ test_path = path_from_root('tests', 'core', 'test_dynamic_cast_2')
+ src, output = (test_path + s for s in ('.in', '.out'))
- int main() {
- const Class* dp = dynamic_cast<const Class*>(&typeid(Class));
- // should return dp == NULL,
- printf("pointer: %p\n", dp);
- }
- '''
- self.do_run(src, "pointer: (nil)")
+ self.do_run_from_file(src, output)
def test_funcptr(self):
src = '''