diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-06 22:38:47 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:35:51 +0200 |
commit | 44a8590a38ce94fc24ea248c246d98b8aea2d8e0 (patch) | |
tree | 3bd6e78b0c526fb1280df96a3c67a4aceb9102ac /tests | |
parent | 42755ef947767abbaa75e6744be99027f153fdad (diff) |
Use do_run_from_file() for test_globaldoubles
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/test_globaldoubles.in | 26 | ||||
-rw-r--r-- | tests/core/test_globaldoubles.out | 2 | ||||
-rw-r--r-- | tests/test_core.py | 29 |
3 files changed, 31 insertions, 26 deletions
diff --git a/tests/core/test_globaldoubles.in b/tests/core/test_globaldoubles.in new file mode 100644 index 00000000..45acc194 --- /dev/null +++ b/tests/core/test_globaldoubles.in @@ -0,0 +1,26 @@ + + #include <stdlib.h> + #include <stdio.h> + + double testVu, testVv, testWu, testWv; + + void Test(double _testVu, double _testVv, double _testWu, double _testWv) + { + testVu = _testVu; + testVv = _testVv; + testWu = _testWu; + testWv = _testWv; + printf("BUG?\n"); + printf("Display: Vu=%f Vv=%f Wu=%f Wv=%f\n", testVu, testVv, testWu, testWv); + } + + int main(void) + { + double v1 = 465.1; + double v2 = 465.2; + double v3 = 160.3; + double v4 = 111.4; + Test(v1, v2, v3, v4); + return 0; + } +
\ No newline at end of file diff --git a/tests/core/test_globaldoubles.out b/tests/core/test_globaldoubles.out new file mode 100644 index 00000000..b47c9691 --- /dev/null +++ b/tests/core/test_globaldoubles.out @@ -0,0 +1,2 @@ +BUG? +Display: Vu=465.100000 Vv=465.200000 Wu=160.300000 Wv=111.400000
\ No newline at end of file diff --git a/tests/test_core.py b/tests/test_core.py index 548b5452..c63f200b 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -794,33 +794,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_globaldoubles(self): - src = r''' - #include <stdlib.h> - #include <stdio.h> - - double testVu, testVv, testWu, testWv; - - void Test(double _testVu, double _testVv, double _testWu, double _testWv) - { - testVu = _testVu; - testVv = _testVv; - testWu = _testWu; - testWv = _testWv; - printf("BUG?\n"); - printf("Display: Vu=%f Vv=%f Wu=%f Wv=%f\n", testVu, testVv, testWu, testWv); - } + test_path = path_from_root('tests', 'core', 'test_globaldoubles') + src, output = (test_path + s for s in ('.in', '.out')) - int main(void) - { - double v1 = 465.1; - double v2 = 465.2; - double v3 = 160.3; - double v4 = 111.4; - Test(v1, v2, v3, v4); - return 0; - } - ''' - self.do_run(src, 'BUG?\nDisplay: Vu=465.100000 Vv=465.200000 Wu=160.300000 Wv=111.400000') + self.do_run_from_file(src, output) def test_math(self): if Settings.USE_TYPED_ARRAYS != 2: return self.skip('requires ta2') |