summaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 11:49:49 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:54 +0200
commit5b3a08da267f4b8bbdf66574dff5dc8066f99691 (patch)
tree80e0fa1d5b1a2e5f76ec445ad386766357d32a30 /tests/test_core.py
parent2bc50ae56c8c1c39fb1362cf02dd263c1f495b35 (diff)
Use do_run_from_file() for test_dynamic_cast_b
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py31
1 files changed, 3 insertions, 28 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index 162d8525..75706525 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1506,35 +1506,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
def test_dynamic_cast_b(self):
if self.emcc_args is None: return self.skip('need libcxxabi')
- src = '''
- #include <stdio.h>
-
- class CBase { virtual void dummy() {} };
- class CDerived : public CBase { int a; };
- class CDerivedest : public CDerived { float b; };
-
- int main ()
- {
- CBase *pa = new CBase;
- CBase *pb = new CDerived;
- CBase *pc = new CDerivedest;
-
- printf("a1: %d\\n", dynamic_cast<CDerivedest*>(pa) != NULL);
- printf("a2: %d\\n", dynamic_cast<CDerived*>(pa) != NULL);
- printf("a3: %d\\n", dynamic_cast<CBase*>(pa) != NULL);
-
- printf("b1: %d\\n", dynamic_cast<CDerivedest*>(pb) != NULL);
- printf("b2: %d\\n", dynamic_cast<CDerived*>(pb) != NULL);
- printf("b3: %d\\n", dynamic_cast<CBase*>(pb) != NULL);
-
- printf("c1: %d\\n", dynamic_cast<CDerivedest*>(pc) != NULL);
- printf("c2: %d\\n", dynamic_cast<CDerived*>(pc) != NULL);
- printf("c3: %d\\n", dynamic_cast<CBase*>(pc) != NULL);
+ test_path = path_from_root('tests', 'core', 'test_dynamic_cast_b')
+ src, output = (test_path + s for s in ('.in', '.out'))
- return 0;
- }
- '''
- self.do_run(src, 'a1: 0\na2: 0\na3: 1\nb1: 0\nb2: 1\nb3: 1\nc1: 1\nc2: 1\nc3: 1\n')
+ self.do_run_from_file(src, output)
def test_dynamic_cast_2(self):
if self.emcc_args is None: return self.skip('need libcxxabi')