summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 12:18:05 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:55 +0200
commit1f8a2909f0ac04a5c1960092b6f32e7645a430ca (patch)
tree174d707edb0ca775315bf684357b241807e7bc8f /tests
parent57626376b846bb41cbd27370eed68699595323bb (diff)
Use do_run_from_file() for test_array2
Diffstat (limited to 'tests')
-rw-r--r--tests/core/test_array2.in15
-rw-r--r--tests/core/test_array2.out1
-rw-r--r--tests/test_core.py18
3 files changed, 19 insertions, 15 deletions
diff --git a/tests/core/test_array2.in b/tests/core/test_array2.in
new file mode 100644
index 00000000..0e5bcbfb
--- /dev/null
+++ b/tests/core/test_array2.in
@@ -0,0 +1,15 @@
+
+ #include <stdio.h>
+
+ static const double grid[4][2] = {
+ {-3/3.,-1/3.},{+1/3.,-3/3.},
+ {-1/3.,+3/3.},{+3/3.,+1/3.}
+ };
+
+ int main() {
+ for (int i = 0; i < 4; i++)
+ printf("%d:%.2f,%.2f ", i, grid[i][0], grid[i][1]);
+ printf("\n");
+ return 0;
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_array2.out b/tests/core/test_array2.out
new file mode 100644
index 00000000..a6ee88bb
--- /dev/null
+++ b/tests/core/test_array2.out
@@ -0,0 +1 @@
+0:-1.00,-0.33 1:0.33,-1.00 2:-0.33,1.00 3:1.00,0.33 \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index 8c098675..d9967858 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1713,22 +1713,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
''', ['2'], force_c=True)
def test_array2(self):
- src = '''
- #include <stdio.h>
-
- static const double grid[4][2] = {
- {-3/3.,-1/3.},{+1/3.,-3/3.},
- {-1/3.,+3/3.},{+3/3.,+1/3.}
- };
+ test_path = path_from_root('tests', 'core', 'test_array2')
+ src, output = (test_path + s for s in ('.in', '.out'))
- int main() {
- for (int i = 0; i < 4; i++)
- printf("%d:%.2f,%.2f ", i, grid[i][0], grid[i][1]);
- printf("\\n");
- return 0;
- }
- '''
- self.do_run(src, '0:-1.00,-0.33 1:0.33,-1.00 2:-0.33,1.00 3:1.00,0.33')
+ self.do_run_from_file(src, output)
def test_array2b(self):
src = '''