diff options
author | alon@honor <none@none> | 2010-09-25 20:57:52 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-09-25 20:57:52 -0700 |
commit | 736dac5109a9899a5a72f12f68d9544cb2b8781b (patch) | |
tree | 03bd06b6d7d7b91bf1b1db7a023d5a342380b54b /tests/runner.py | |
parent | b94c061e122f155cc5c1262a1bb470cb49ee04b4 (diff) |
fix for arrays of arrays +test
Diffstat (limited to 'tests/runner.py')
-rw-r--r-- | tests/runner.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py index 53c553d0..fe208c25 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -439,6 +439,24 @@ class T(unittest.TestCase): ''' self.do_test(src, '*zzcheezzz*') + def test_array2(self): + src = ''' + #include <stdio.h> + + static const double grid[4][2] = { + {-3/3.,-1/3.},{+1/3.,-3/3.}, + {-1/3.,+3/3.},{+3/3.,+1/3.} + }; + + int main() { + for (int i = 0; i < 4; i++) + printf("%d:%.2f,%.2f ", i, grid[i][0], grid[i][1]); + printf("\\n"); + return 0; + } + ''' + self.do_test(src, '0:-1.00,-0.33 1:0.33,-1.00 2:-0.33,1.00 3:1.00,0.33') + def test_constglobalstructs(self): src = ''' #include <stdio.h> @@ -665,7 +683,7 @@ class T(unittest.TestCase): return 0; } ''' - self.do_test(src, '*0,0,0*') + self.do_test(src, '*0.00,0.00,0.00*') def test_nestedstructs(self): src = ''' |