diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 15:54:29 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:36:00 +0200 |
commit | 0411512023fa05dee8bb16bd23be6e7b303d2557 (patch) | |
tree | 98afb371f05986d5fe57a83d65b4978d395ad5ec /tests | |
parent | cfc9c359296d611f158457fc6a54ed8ed2844684 (diff) |
Use do_run_from_file() for test_sscanf_hex
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/test_sscanf_hex.in | 9 | ||||
-rw-r--r-- | tests/core/test_sscanf_hex.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 12 |
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''' |