diff options
author | max99x <max99x@gmail.com> | 2011-07-30 16:13:42 +0300 |
---|---|---|
committer | max99x <max99x@gmail.com> | 2011-07-30 16:13:42 +0300 |
commit | d1ed9565a7e3dc28e7012a2bdfa794d8aa88ad49 (patch) | |
tree | 16b2ea75cba2c5d6b9ba96e5f7ad34461f7bf764 /tests/runner.py | |
parent | ee54249f11b9e4048dfc459bd8e432617c81d4e1 (diff) |
Added various library functions, mostly as stubs, aliases or TODOs;
Now every function used by CPython is implemented or marked with a TODO.
Diffstat (limited to 'tests/runner.py')
-rw-r--r-- | tests/runner.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index d1d12dfc..148eb106 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -2607,6 +2607,32 @@ if 'benchmark' not in sys.argv: expected = open(path_from_root('tests', 'env', 'output.txt'), 'r').read() self.do_test(src, expected) + def test_getloadavg(self): + src = r''' + #include <stdio.h> + #include <stdlib.h> + + int main() { + double load[5] = {42.13, 42.13, 42.13, 42.13, 42.13}; + printf("ret: %d\n", getloadavg(load, 5)); + printf("load[0]: %lf\n", load[0]); + printf("load[1]: %lf\n", load[1]); + printf("load[2]: %lf\n", load[2]); + printf("load[3]: %lf\n", load[3]); + printf("load[4]: %lf\n", load[4]); + return 0; + } + ''' + expected = ''' + ret: 3 + load[0]: 0.100000 + load[1]: 0.100000 + load[2]: 0.100000 + load[3]: 42.130000 + load[4]: 42.130000 + ''' + self.do_test(src, re.sub('(^|\n)\s+', '\\1', expected)) + def test_ctype(self): src = open(path_from_root('tests', 'ctype', 'src.c'), 'r').read() expected = open(path_from_root('tests', 'ctype', 'output.txt'), 'r').read() |