diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 12:19:18 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:35:55 +0200 |
commit | e4a726c7cc08bf3dbfe2b67927bf4f17390bc134 (patch) | |
tree | b445c6c54f2aa4122133cbea099d9275310ba71e | |
parent | 1f8a2909f0ac04a5c1960092b6f32e7645a430ca (diff) |
Use do_run_from_file() for test_array2b
-rw-r--r-- | tests/core/test_array2b.in | 16 | ||||
-rw-r--r-- | tests/core/test_array2b.out | 2 | ||||
-rw-r--r-- | tests/test_core.py | 20 |
3 files changed, 21 insertions, 17 deletions
diff --git a/tests/core/test_array2b.in b/tests/core/test_array2b.in new file mode 100644 index 00000000..b94821d8 --- /dev/null +++ b/tests/core/test_array2b.in @@ -0,0 +1,16 @@ + + #include <stdio.h> + + static const struct { + unsigned char left; + unsigned char right; + } prioritah[] = { + {6, 6}, {6, 6}, {7, 95}, {7, 7} + }; + + int main() { + printf("*%d,%d\n", prioritah[1].left, prioritah[1].right); + printf("%d,%d*\n", prioritah[2].left, prioritah[2].right); + return 0; + } +
\ No newline at end of file diff --git a/tests/core/test_array2b.out b/tests/core/test_array2b.out new file mode 100644 index 00000000..422896dc --- /dev/null +++ b/tests/core/test_array2b.out @@ -0,0 +1,2 @@ +*6,6 +7,95*
\ No newline at end of file diff --git a/tests/test_core.py b/tests/test_core.py index d9967858..d3afa540 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1719,24 +1719,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_array2b(self): - src = ''' - #include <stdio.h> - - static const struct { - unsigned char left; - unsigned char right; - } prioritah[] = { - {6, 6}, {6, 6}, {7, 95}, {7, 7} - }; - - int main() { - printf("*%d,%d\\n", prioritah[1].left, prioritah[1].right); - printf("%d,%d*\\n", prioritah[2].left, prioritah[2].right); - return 0; - } - ''' - self.do_run(src, '*6,6\n7,95*') + test_path = path_from_root('tests', 'core', 'test_array2b') + src, output = (test_path + s for s in ('.in', '.out')) + self.do_run_from_file(src, output) def test_constglobalstructs(self): src = ''' |