summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/core/test_i64_i16.in12
-rw-r--r--tests/core/test_i64_i16.out1
-rw-r--r--tests/test_core.py17
3 files changed, 17 insertions, 13 deletions
diff --git a/tests/core/test_i64_i16.in b/tests/core/test_i64_i16.in
new file mode 100644
index 00000000..dcd9a69e
--- /dev/null
+++ b/tests/core/test_i64_i16.in
@@ -0,0 +1,12 @@
+
+ #include <stdint.h>
+ #include <stdio.h>
+ int main(int argc, char ** argv){
+ int y=-133;
+ int64_t x= ((int64_t)((short)(y)))*(100 + argc);
+ if(x>0)
+ printf(">0\n");
+ else
+ printf("<=0\n");
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_i64_i16.out b/tests/core/test_i64_i16.out
new file mode 100644
index 00000000..01adb429
--- /dev/null
+++ b/tests/core/test_i64_i16.out
@@ -0,0 +1 @@
+<=0 \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index f59d73a9..ae3aa26b 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -403,19 +403,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
def test_i64_i16(self):
if Settings.USE_TYPED_ARRAYS != 2: return self.skip('full i64 stuff only in ta2')
- src = r'''
- #include <stdint.h>
- #include <stdio.h>
- int main(int argc, char ** argv){
- int y=-133;
- int64_t x= ((int64_t)((short)(y)))*(100 + argc);
- if(x>0)
- printf(">0\n");
- else
- printf("<=0\n");
- }
- '''
- self.do_run(src, '<=0')
+ test_path = path_from_root('tests', 'core', 'test_i64_i16')
+ src, output = (test_path + s for s in ('.in', '.out'))
+
+ self.do_run_from_file(src, output)
def test_i64_qdouble(self):
if Settings.USE_TYPED_ARRAYS != 2: return self.skip('full i64 stuff only in ta2')