diff options
author | Vadim Zeitlin <vz-swig@zeitlins.org> | 2015-01-05 02:50:24 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2015-01-09 00:33:57 +0000 |
commit | 34787ab98e86b1c82a4d41cecf58ff01d816a4ae (patch) | |
tree | 89bb259fb9028668c186c2283115099e6603117e /Examples | |
parent | af43f904843f02a2d221922e61f30405badec6f1 (diff) | |
download | swig-34787ab98e86b1c82a4d41cecf58ff01d816a4ae.tar.gz |
Python default argument test cases from issue #294
Diffstat (limited to 'Examples')
-rw-r--r-- | Examples/test-suite/default_args.i | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Examples/test-suite/default_args.i b/Examples/test-suite/default_args.i index 839d28e3e..50667d9b9 100644 --- a/Examples/test-suite/default_args.i +++ b/Examples/test-suite/default_args.i @@ -13,6 +13,12 @@ %inline %{ #include <string> + // All kinds of numbers: hex, octal (which pose special problems to Python), negative... + void lots_of_args(int pos = -1, unsigned rgb = 0xabcdef, int mode = 0644) { } + + // Long long arguments are not handled at Python level currently but still work. + void seek(long long offset = 0LL) {} + // Anonymous arguments int anonymous(int = 7771); int anonymous(int x) { return x; } @@ -29,6 +35,12 @@ bool blah(speed s = FAST, flavor f = SWEET) { return (s == FAST && f == SWEET); }; }; + // using base class enum in a derived class + class DerivedEnumClass : public EnumClass { + public: + void accelerate(speed s = SLOW) { } + }; + // casts const char * casts1(const char *m = (const char *) NULL) { char *ret = NULL; @@ -199,6 +211,7 @@ namespace Space { struct Klass { int val; Klass(int val = -1) : val(val) {} + static Klass inc(int n = 1, const Klass& k = Klass()) { return Klass(k.val + n); } }; Klass constructorcall(const Klass& k = Klass()) { return k; } |