summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/core/test_i64_qdouble.in21
-rw-r--r--tests/core/test_i64_qdouble.out1
-rw-r--r--tests/test_core.py24
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')