aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 15:52:12 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:36:00 +0200
commit91e199c9336a8f06bc0e85b084d5a1f8cf60f4aa (patch)
tree58075691fef624f6cac6c5ff131d256086ccd373 /tests
parentf7077dc65917f2346006931506f6f09f701b5b33 (diff)
Use do_run_from_file() for test_sscanf_skip
Diffstat (limited to 'tests')
-rw-r--r--tests/core/test_sscanf_skip.in16
-rw-r--r--tests/core/test_sscanf_skip.out4
-rw-r--r--tests/test_core.py19
3 files changed, 23 insertions, 16 deletions
diff --git a/tests/core/test_sscanf_skip.in b/tests/core/test_sscanf_skip.in
new file mode 100644
index 00000000..0faae7aa
--- /dev/null
+++ b/tests/core/test_sscanf_skip.in
@@ -0,0 +1,16 @@
+
+ #include <stdint.h>
+ #include <stdio.h>
+
+ int main(){
+ int val1;
+ printf("%d\n", sscanf("10 20 30 40", "%*lld %*d %d", &val1));
+ printf("%d\n", val1);
+
+ int64_t large, val2;
+ printf("%d\n", sscanf("1000000 -1125899906842620 -123 -1073741823", "%lld %*lld %ld %*d", &large, &val2));
+ printf("%lld,%d\n", large, val2);
+
+ return 0;
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_sscanf_skip.out b/tests/core/test_sscanf_skip.out
new file mode 100644
index 00000000..cf1cdfb8
--- /dev/null
+++ b/tests/core/test_sscanf_skip.out
@@ -0,0 +1,4 @@
+1
+30
+2
+1000000,-123
diff --git a/tests/test_core.py b/tests/test_core.py
index 2b4d7e52..676b55ca 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -3747,23 +3747,10 @@ Pass: 0.000012 0.000012''')
def test_sscanf_skip(self):
if Settings.USE_TYPED_ARRAYS != 2: return self.skip("need ta2 for full i64")
- src = r'''
- #include <stdint.h>
- #include <stdio.h>
-
- int main(){
- int val1;
- printf("%d\n", sscanf("10 20 30 40", "%*lld %*d %d", &val1));
- printf("%d\n", val1);
-
- int64_t large, val2;
- printf("%d\n", sscanf("1000000 -1125899906842620 -123 -1073741823", "%lld %*lld %ld %*d", &large, &val2));
- printf("%lld,%d\n", large, val2);
+ test_path = path_from_root('tests', 'core', 'test_sscanf_skip')
+ src, output = (test_path + s for s in ('.in', '.out'))
- return 0;
- }
- '''
- self.do_run(src, '1\n30\n2\n1000000,-123\n')
+ self.do_run_from_file(src, output)
def test_sscanf_caps(self):
src = r'''