diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-06 20:41:37 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:35:50 +0200 |
commit | ca35cf2e6a10ffcf5ecdca04b2055e65bdf45270 (patch) | |
tree | 8a8285120953e9fa5bf20ca7d50f8492d825e081 | |
parent | 7e0db00dff7387fef28aaecd771c0d8668975fe7 (diff) |
Use do_run_from_file() for test_i64_qdouble
-rw-r--r-- | tests/core/test_i64_qdouble.in | 21 | ||||
-rw-r--r-- | tests/core/test_i64_qdouble.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 24 |
3 files changed, 25 insertions, 21 deletions
diff --git a/tests/core/test_i64_qdouble.in b/tests/core/test_i64_qdouble.in new file mode 100644 index 00000000..1b8297e4 --- /dev/null +++ b/tests/core/test_i64_qdouble.in @@ -0,0 +1,21 @@ + + #include <stdio.h> + typedef long long qint64; /* 64 bit signed */ + typedef double qreal; + + + int main(int argc, char **argv) + { + qreal c = 111; + qint64 d = -111 + (argc - 1); + c += d; + if (c < -1 || c > 1) + { + printf("Failed!\n"); + } + else + { + printf("Succeeded!\n"); + } + }; +
\ No newline at end of file diff --git a/tests/core/test_i64_qdouble.out b/tests/core/test_i64_qdouble.out new file mode 100644 index 00000000..0b9e5e9e --- /dev/null +++ b/tests/core/test_i64_qdouble.out @@ -0,0 +1 @@ +Succeeded!
\ No newline at end of file diff --git a/tests/test_core.py b/tests/test_core.py index ae3aa26b..00a98363 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -411,28 +411,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co def test_i64_qdouble(self): if Settings.USE_TYPED_ARRAYS != 2: return self.skip('full i64 stuff only in ta2') - src = r''' - #include <stdio.h> - typedef long long qint64; /* 64 bit signed */ - typedef double qreal; - + test_path = path_from_root('tests', 'core', 'test_i64_qdouble') + src, output = (test_path + s for s in ('.in', '.out')) - int main(int argc, char **argv) - { - qreal c = 111; - qint64 d = -111 + (argc - 1); - c += d; - if (c < -1 || c > 1) - { - printf("Failed!\n"); - } - else - { - printf("Succeeded!\n"); - } - }; - ''' - self.do_run(src, 'Succeeded!') + self.do_run_from_file(src, output) def test_i64_varargs(self): if Settings.USE_TYPED_ARRAYS != 2: return self.skip('full i64 stuff only in ta2') |