summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-06 20:36:33 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:49 +0200
commit8896b0e5c916fd9aa7d61f715ca245a1b06396d2 (patch)
tree43ea4932956347c05a0e868776c8026f958a0b64
parentbb0344a2537a908492b2c164996d910f6dd7ac3a (diff)
Use do_run_from_file() for test_i64_7z
-rw-r--r--tests/core/test_i64_7z.in17
-rw-r--r--tests/core/test_i64_7z.out1
-rw-r--r--tests/test_core.py22
3 files changed, 22 insertions, 18 deletions
diff --git a/tests/core/test_i64_7z.in b/tests/core/test_i64_7z.in
new file mode 100644
index 00000000..1d2f03a8
--- /dev/null
+++ b/tests/core/test_i64_7z.in
@@ -0,0 +1,17 @@
+
+ #include <stdint.h>
+ #include <stdio.h>
+ uint64_t a, b;
+ int main(int argc, char *argv[])
+ {
+ a = argc;
+ b = argv[1][0];
+ printf("%d,%d\n", a, b);
+ if (a > a + b || a > a + b + 1) {
+ printf("one %lld, %lld", a, b);
+ return 0;
+ }
+ printf("zero %lld, %lld", a, b);
+ return 0;
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_i64_7z.out b/tests/core/test_i64_7z.out
new file mode 100644
index 00000000..3e9d35a4
--- /dev/null
+++ b/tests/core/test_i64_7z.out
@@ -0,0 +1 @@
+zero 2, 104 \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index 0a083a80..f59d73a9 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -395,24 +395,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
def test_i64_7z(self):
if Settings.USE_TYPED_ARRAYS != 2: return self.skip('full i64 stuff only in ta2')
- src = r'''
- #include <stdint.h>
- #include <stdio.h>
- uint64_t a, b;
- int main(int argc, char *argv[])
- {
- a = argc;
- b = argv[1][0];
- printf("%d,%d\n", a, b);
- if (a > a + b || a > a + b + 1) {
- printf("one %lld, %lld", a, b);
- return 0;
- }
- printf("zero %lld, %lld", a, b);
- return 0;
- }
- '''
- self.do_run(src, 'zero 2, 104', ['hallo'])
+ test_path = path_from_root('tests', 'core', 'test_i64_7z')
+ src, output = (test_path + s for s in ('.in', '.out'))
+
+ self.do_run_from_file(src, output, ['hallo'])
def test_i64_i16(self):
if Settings.USE_TYPED_ARRAYS != 2: return self.skip('full i64 stuff only in ta2')