summaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-06 21:46:38 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:50 +0200
commit3dcf74e687a4cf376d7cfdc6452a745b47687c4d (patch)
tree8adc742156350aa96e79eeccff30c3a6ec9ca529 /tests/test_core.py
parenta611d82983c7a6d08039b60ac93fd89fe82e875d (diff)
Use do_run_from_file() for test_bitfields
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py29
1 files changed, 5 insertions, 24 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index 0ddbede2..59ad79d8 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -754,30 +754,11 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
def test_bitfields(self):
if self.emcc_args is None: Settings.SAFE_HEAP = 0 # bitfields do loads on invalid areas, by design
- src = '''
- #include <stdio.h>
- struct bitty {
- unsigned x : 1;
- unsigned y : 1;
- unsigned z : 1;
- };
- int main()
- {
- bitty b;
- printf("*");
- for (int i = 0; i <= 1; i++)
- for (int j = 0; j <= 1; j++)
- for (int k = 0; k <= 1; k++) {
- b.x = i;
- b.y = j;
- b.z = k;
- printf("%d,%d,%d,", b.x, b.y, b.z);
- }
- printf("*\\n");
- return 0;
- }
- '''
- self.do_run(src, '*0,0,0,0,0,1,0,1,0,0,1,1,1,0,0,1,0,1,1,1,0,1,1,1,*')
+
+ test_path = path_from_root('tests', 'core', 'test_bitfields')
+ src, output = (test_path + s for s in ('.in', '.out'))
+
+ self.do_run_from_file(src, output)
def test_floatvars(self):
src = '''