diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-10-29 13:10:22 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-10-29 13:10:22 -0700 |
commit | ce31f61312f41eebb7be52a2a7bcce5380e332fc (patch) | |
tree | 31180c78eebe1ac1460cc04f6b1fa1f4bafaa433 | |
parent | a23cd90b35d8c624fc1d39829288c87059410f67 (diff) |
add working test for <vector>
-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 790171bb..901adc8e 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -2910,6 +2910,8 @@ if 'benchmark' not in str(sys.argv): self.do_run(src, expected) CORRECT_SIGNS = 0 + # libc++ tests + def test_iostream(self): src = ''' #include <iostream> @@ -2923,6 +2925,41 @@ if 'benchmark' not in str(sys.argv): self.do_run(src, 'hello world') + def test_stdvec(self): + src = ''' + #include <vector> + #include <stdio.h> + + struct S { + int a; + float b; + }; + + void foo(int a, float b) + { + printf("%d:%.2f\\n", a, b); + } + + int main ( int argc, char *argv[] ) + { + std::vector<S> ar; + S s; + + s.a = 789; + s.b = 123.456f; + ar.push_back(s); + + s.a = 0; + s.b = 100.1f; + ar.push_back(s); + + foo(ar[0].a, ar[0].b); + foo(ar[1].a, ar[1].b); + } + ''' + + self.do_run(src, '789:123.46\n0:100.1') + ### 'Big' tests def test_fannkuch(self): |