diff options
author | max99x <max99x@gmail.com> | 2011-07-20 10:20:09 +0300 |
---|---|---|
committer | max99x <max99x@gmail.com> | 2011-07-21 02:48:24 +0300 |
commit | 10ca04685b6e0ec0e8089fbe859e0085d8020622 (patch) | |
tree | e256b40bfbf8324e73c977b82c36cc4a227f7be5 /tests/runner.py | |
parent | 278416d5426493959216d46279d3c40f91f33f81 (diff) |
Implemented <fcntl.h>.
Diffstat (limited to 'tests/runner.py')
-rw-r--r-- | tests/runner.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index 27c19867..4a91f59e 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -2173,6 +2173,43 @@ if 'benchmark' not in sys.argv: expected = open(path_from_root('tests', 'stat', 'output.txt'), 'r').read() self.do_test(src, expected, post_build=addPreRun) + def test_fcntl(self): + def addPreRun(filename): + src = open(filename, 'r').read().replace( + '// {{PRE_RUN_ADDITIONS}}', + "FS.createDataFile('/', 'test', 'abcdef', true, true);" + ) + open(filename, 'w').write(src) + src = open(path_from_root('tests', 'fcntl', 'src.c'), 'r').read() + expected = open(path_from_root('tests', 'fcntl', 'output.txt'), 'r').read() + self.do_test(src, expected, post_build=addPreRun) + + def test_fcntl_open(self): + def addPreRun(filename): + src = open(filename, 'r').read().replace( + '// {{PRE_RUN_ADDITIONS}}', + ''' + FS.createDataFile('/', 'test-file', 'abcdef', true, true); + FS.createFolder('/', 'test-folder', true, true); + FS.root.write = true; + ''' + ) + open(filename, 'w').write(src) + src = open(path_from_root('tests', 'fcntl-open', 'src.c'), 'r').read() + expected = open(path_from_root('tests', 'fcntl-open', 'output.txt'), 'r').read() + self.do_test(src, expected, post_build=addPreRun) + + def test_fcntl_misc(self): + def addPreRun(filename): + src = open(filename, 'r').read().replace( + '// {{PRE_RUN_ADDITIONS}}', + "FS.createDataFile('/', 'test', 'abcdef', true, true);" + ) + open(filename, 'w').write(src) + src = open(path_from_root('tests', 'fcntl-misc', 'src.c'), 'r').read() + expected = open(path_from_root('tests', 'fcntl-misc', 'output.txt'), 'r').read() + self.do_test(src, expected, post_build=addPreRun) + def test_statvfs(self): src = r''' #include <stdio.h> |