diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-07-12 07:43:52 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-07-12 07:43:52 -0700 |
commit | 2a0f3ba46616262a3b643bf8927363a320118f3f (patch) | |
tree | 09578a3e974abdc486eadf3c16ab6dd95647ab0f /tests | |
parent | 8f49ea85f58d173db398e8b87f3e4ea89a79a87b (diff) |
fscanf
Diffstat (limited to 'tests')
-rw-r--r-- | tests/files.cpp | 13 | ||||
-rw-r--r-- | tests/runner.py | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/tests/files.cpp b/tests/files.cpp index 1167bbdf..6283c4f1 100644 --- a/tests/files.cpp +++ b/tests/files.cpp @@ -76,6 +76,19 @@ int main() fclose(other); + // fscanf + + outf = fopen("fscan.f", "w"); + fprintf(outf, "10 hello"); + fclose(outf); + + int number; + char text[100]; + inf = fopen("fscan.f", "r"); + num = fscanf(inf, "%d %s", &number, text); + fclose(inf); + printf("fscanfed: %d - %s\n", number, text); + return 0; } diff --git a/tests/runner.py b/tests/runner.py index b49edf38..3d122cd8 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -2032,7 +2032,7 @@ if 'benchmark' not in sys.argv: other.close() src = open(path_from_root('tests', 'files.cpp'), 'r').read() - self.do_test(src, 'size: 7\ndata: 100,-56,50,25,10,77,123\ninput:hi there!\ntexto\ntexte\n5 : 10,30,20,11,88\nother=some data.\nseeked=me da.\nseeked=ata.\nseeked=ta.', post_build=post) + self.do_test(src, 'size: 7\ndata: 100,-56,50,25,10,77,123\ninput:hi there!\ntexto\ntexte\n5 : 10,30,20,11,88\nother=some data.\nseeked=me da.\nseeked=ata.\nseeked=ta.\nfscanfed: 10 - hello\n', post_build=post) ### 'Big' tests |