diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 15:45:12 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:36:00 +0200 |
commit | dff0b829dd8e624942eef87385ddbe72b3695e8e (patch) | |
tree | b4e14e864b60bf54881be74d026dac7ff1f9c14c /tests | |
parent | d72499d0a166dba8371cbdd627932aa82b3f58ef (diff) |
Use do_run_from_file() for test_sscanf_4
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/test_sscanf_4.in | 11 | ||||
-rw-r--r-- | tests/core/test_sscanf_4.out | 2 | ||||
-rw-r--r-- | tests/test_core.py | 14 |
3 files changed, 16 insertions, 11 deletions
diff --git a/tests/core/test_sscanf_4.in b/tests/core/test_sscanf_4.in new file mode 100644 index 00000000..b54176c5 --- /dev/null +++ b/tests/core/test_sscanf_4.in @@ -0,0 +1,11 @@ + + #include <stdio.h> + + int main() + { + char pYear[16], pMonth[16], pDay[16], pDate[64]; + printf("%d\n", sscanf("Nov 19 2012", "%s%s%s", pMonth, pDay, pYear)); + printf("day %s, month %s, year %s \n", pDay, pMonth, pYear); + return(0); + } +
\ No newline at end of file diff --git a/tests/core/test_sscanf_4.out b/tests/core/test_sscanf_4.out new file mode 100644 index 00000000..02dba361 --- /dev/null +++ b/tests/core/test_sscanf_4.out @@ -0,0 +1,2 @@ +3 +day 19, month Nov, year 2012
\ No newline at end of file diff --git a/tests/test_core.py b/tests/test_core.py index d89cb179..2b9a1f42 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -3727,18 +3727,10 @@ Pass: 0.000012 0.000012''') self.do_run_from_file(src, output) def test_sscanf_4(self): - src = r''' - #include <stdio.h> + test_path = path_from_root('tests', 'core', 'test_sscanf_4') + src, output = (test_path + s for s in ('.in', '.out')) - int main() - { - char pYear[16], pMonth[16], pDay[16], pDate[64]; - printf("%d\n", sscanf("Nov 19 2012", "%s%s%s", pMonth, pDay, pYear)); - printf("day %s, month %s, year %s \n", pDay, pMonth, pYear); - return(0); - } - ''' - self.do_run(src, '3\nday 19, month Nov, year 2012'); + self.do_run_from_file(src, output) def test_sscanf_5(self): src = r''' |