diff options
author | alon@honor <none@none> | 2010-09-04 16:46:11 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-09-04 16:46:11 -0700 |
commit | 4344835f29a8812a2ae0ab45fffbaef1add0b08d (patch) | |
tree | 0c31f601208856245ff5985a23aa34180626764f /tests | |
parent | 6e15b7617b8a641faa96aed18e1644d39ccab09e (diff) |
initial work towards varargs
Diffstat (limited to 'tests')
-rw-r--r-- | tests/runner.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index 1509ac28..26e0d0f5 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -557,6 +557,28 @@ class T(unittest.TestCase): ''' self.do_test(src, '*96,97,98,101,101*') + def zzztest_varargs(self): + src = ''' + #include <stdio.h> + #include "stdarg.h" + + void vary(const char *s, ...) + { + va_list v; + va_start(v, s); + char d[20]; + vsnprintf(d, 20, s, v); + puts(d); + va_end(v); + } + + int main() { + vary("*cheez: %d+%d*", 10, 23); + return 0; + } + ''' + self.do_test(src, '*cheez: 10+24*') + def test_fannkuch(self): results = [ (1,0), (2,1), (3,2), (4,4), (5,7), (6,10), (7, 16), (8,22) ] for i, j in results: |