summaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 11:39:40 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:54 +0200
commit6266030d1119c191f295ccc2e7ac7e1a78349b48 (patch)
treecfaf8261b159996e3aeacbac750c681215664911 /tests/test_core.py
parent70896abbf586e1cda0b25faf2500f74a02a85bf4 (diff)
Use do_run_from_file() for test_inherit
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py30
1 files changed, 4 insertions, 26 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index eba924dc..d2e4909b 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1401,32 +1401,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
self.do_run_from_file(src, output)
def test_inherit(self):
- src = '''
- #include <stdio.h>
- struct Parent {
- int x1, x2;
- };
- struct Child : Parent {
- int y;
- };
- int main()
- {
- Parent a;
- a.x1 = 50;
- a.x2 = 87;
- Child b;
- b.x1 = 78;
- b.x2 = 550;
- b.y = 101;
- Child* c = (Child*)&a;
- c->x1 ++;
- c = &b;
- c->y --;
- printf("*%d,%d,%d,%d,%d,%d,%d*\\n", a.x1, a.x2, b.x1, b.x2, b.y, c->x1, c->x2);
- return 0;
- }
- '''
- self.do_run(src, '*51,87,78,550,100,78,550*')
+ test_path = path_from_root('tests', 'core', 'test_inherit')
+ src, output = (test_path + s for s in ('.in', '.out'))
+
+ self.do_run_from_file(src, output)
def test_isdigit_l(self):
if self.emcc_args is None: return self.skip('no libcxx inclusion without emcc')