more tests

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5784 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-03-21 23:38:59 +00:00
commit 5a656bf645
13 changed files with 161 additions and 18 deletions

View file

@ -1,6 +1,6 @@
%module lib_std_pair
%include "std_pair.i"
%include std_pair.i
%{
struct A
@ -13,6 +13,7 @@
namespace std {
%template() pair<double, double>;
%template(IntPair) pair<int, int>;
%template(AIntPair) pair<A, int>;
@ -20,6 +21,8 @@ namespace std {
%template(IntAPair) pair<int, A>;
}
%apply std::pair<int,int> *INOUT {std::pair<int,int> *INOUT2};
%inline %{
/* Test the "out" typemap for pair<T, U> */
@ -72,6 +75,44 @@ std::pair<int, int>
return p;
}
void
d_inout(double *INOUT) {
*INOUT += *INOUT;
}
void
d_inout(int *INOUT) {
*INOUT += *INOUT;
}
int
d_inout2(double *INOUT) {
*INOUT += *INOUT;
return 1;
}
void
p_inout(std::pair<int, int> *INOUT) {
std::swap(INOUT->first, INOUT->second);
}
int
p_inout2(std::pair<int, int> *INOUT) {
std::swap(INOUT->first, INOUT->second);
return 1;
}
void
p_inout3(std::pair<int,int> *INOUT, std::pair<int,int> *INOUT2) {
std::swap(*INOUT, *INOUT2);
}
void
p_inoutd(std::pair<double, double> *INOUT) {
std::swap(INOUT->first, INOUT->second);
}
#if 0
std::pair<char, char>
p_ident(std::pair<char, char> p, const std::pair<char, char>& q) {
@ -100,6 +141,8 @@ std::pair<int, int>
p_ident(std::pair<int, int> p, const std::pair<A, B>& q) {
return p;
}
#endif
%}