diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/test_addr_of_stacked.in | 14 | ||||
-rw-r--r-- | tests/core/test_addr_of_stacked.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 19 |
3 files changed, 19 insertions, 15 deletions
diff --git a/tests/core/test_addr_of_stacked.in b/tests/core/test_addr_of_stacked.in new file mode 100644 index 00000000..af5a6e32 --- /dev/null +++ b/tests/core/test_addr_of_stacked.in @@ -0,0 +1,14 @@ + + #include <stdio.h> + void alter(int *y) + { + *y += 5; + } + int main() + { + int x = 2; + alter(&x); + printf("*%d*\n", x); + return 0; + } +
\ No newline at end of file diff --git a/tests/core/test_addr_of_stacked.out b/tests/core/test_addr_of_stacked.out new file mode 100644 index 00000000..2b8cf4a1 --- /dev/null +++ b/tests/core/test_addr_of_stacked.out @@ -0,0 +1 @@ +*7*
\ No newline at end of file diff --git a/tests/test_core.py b/tests/test_core.py index ffbdf487..c6ab5ab9 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -996,21 +996,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co self.do_run(self.gen_struct_src.replace('{{gen_struct}}', 'new S').replace('{{del_struct}}', 'delete'), '*51,62*') def test_addr_of_stacked(self): - src = ''' - #include <stdio.h> - void alter(int *y) - { - *y += 5; - } - int main() - { - int x = 2; - alter(&x); - printf("*%d*\\n", x); - return 0; - } - ''' - self.do_run(src, '*7*') + test_path = path_from_root('tests', 'core', 'test_addr_of_stacked') + src, output = (test_path + s for s in ('.in', '.out')) + + self.do_run_from_file(src, output) def test_globals(self): src = ''' |