diff options
author | alon@honor <none@none> | 2010-08-28 13:38:43 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-08-28 13:38:43 -0700 |
commit | 22b8a96321ca0e284fb96916943286d7f4b49187 (patch) | |
tree | 7ec7b54af8fbf94726d33b89bf4e775364dc4f7b /tests/runner.py | |
parent | 926940a96b315021196dc79f5f9664ecc51dfbb4 (diff) |
fix 3 bugs: printf error, no IEEEUnhexing, and <{'s. 2 new tests
Diffstat (limited to 'tests/runner.py')
-rw-r--r-- | tests/runner.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index bc72071c..4e550aba 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -152,6 +152,19 @@ class T(unittest.TestCase): ''' self.do_test(src, '*5,23,10,19,101,1*') + def test_floatvars(self): + src = ''' + #include <stdio.h> + int main() + { + float x = 1.234, y = 3.5; + y *= 3; + printf("*%d,%f,%d,%f\\n", int(y), y, (int)x, x); + return 0; + } + ''' + self.do_test(src, '*10,10.5,1,1.2339') + def test_if(self): src = ''' #include <stdio.h> @@ -378,6 +391,24 @@ class T(unittest.TestCase): ''' self.do_test(src, '*11,74*') + def test_emptyclass(self): + src = ''' + #include <stdio.h> + + struct Randomized { + Randomized(int x) { + printf("*zzcheezzz*\\n"); + } + }; + + int main( int argc, const char *argv[] ) { + new Randomized(55); + + return 0; + } + ''' + self.do_test(src, '*zzcheezzz*') + def zzzzzzzzzzzzzzztest_constglobalstructs(self): # TODO: make this work src = ''' #include <stdio.h> |