aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 15:54:29 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:36:00 +0200
commit0411512023fa05dee8bb16bd23be6e7b303d2557 (patch)
tree98afb371f05986d5fe57a83d65b4978d395ad5ec /tests
parentcfc9c359296d611f158457fc6a54ed8ed2844684 (diff)
Use do_run_from_file() for test_sscanf_hex
Diffstat (limited to 'tests')
-rw-r--r--tests/core/test_sscanf_hex.in9
-rw-r--r--tests/core/test_sscanf_hex.out1
-rw-r--r--tests/test_core.py12
3 files changed, 13 insertions, 9 deletions
diff --git a/tests/core/test_sscanf_hex.in b/tests/core/test_sscanf_hex.in
new file mode 100644
index 00000000..af6c158e
--- /dev/null
+++ b/tests/core/test_sscanf_hex.in
@@ -0,0 +1,9 @@
+
+ #include "stdio.h"
+
+ int main(){
+ unsigned int a, b;
+ sscanf("0x12AB 12AB", "%x %x", &a, &b);
+ printf("%d %d\n", a, b);
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_sscanf_hex.out b/tests/core/test_sscanf_hex.out
new file mode 100644
index 00000000..ac855044
--- /dev/null
+++ b/tests/core/test_sscanf_hex.out
@@ -0,0 +1 @@
+4779 4779 \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index 40361b4c..c4fef6eb 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -3759,16 +3759,10 @@ Pass: 0.000012 0.000012''')
self.do_run_from_file(src, output)
def test_sscanf_hex(self):
- src = r'''
- #include "stdio.h"
+ test_path = path_from_root('tests', 'core', 'test_sscanf_hex')
+ src, output = (test_path + s for s in ('.in', '.out'))
- int main(){
- unsigned int a, b;
- sscanf("0x12AB 12AB", "%x %x", &a, &b);
- printf("%d %d\n", a, b);
- }
- '''
- self.do_run(src, '4779 4779')
+ self.do_run_from_file(src, output)
def test_sscanf_float(self):
src = r'''