diff options
author | alon@honor <none@none> | 2010-10-23 20:37:49 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-10-23 20:37:49 -0700 |
commit | fcddeb2e6455db795e86be78f1679bbfeb27c52d (patch) | |
tree | 03bc2ad82583dae8b35b99cc992ac28d66eac150 /tests | |
parent | f221a9bada6e054c0bf6a99db1bb0c1f1d8d349d (diff) |
support for pure virtual functions
Diffstat (limited to 'tests')
-rw-r--r-- | tests/runner.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/runner.py b/tests/runner.py index 67e3cfba..879f3cbc 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -479,21 +479,26 @@ if 'benchmark' not in sys.argv: def test_polymorph(self): src = ''' #include <stdio.h> - struct Parent { + struct Pure { + virtual int implme() = 0; + }; + struct Parent : Pure { virtual int getit() { return 11; }; + int implme() { return 32; } }; struct Child : Parent { int getit() { return 74; } + int implme() { return 1012; } }; int main() { Parent *x = new Parent(); Parent *y = new Child(); - printf("*%d,%d*\\n", x->getit(), y->getit()); + printf("*%d,%d,%d,%d*\\n", x->getit(), y->getit(), x->implme(), y->implme()); return 0; } ''' - self.do_test(src, '*11,74*') + self.do_test(src, '*11,74,32,1012*') def test_funcptr(self): src = ''' |