add complex test

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5693 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-01-28 01:38:59 +00:00
commit cff86e376c
2 changed files with 37 additions and 0 deletions

View file

@ -0,0 +1,31 @@
%module complextest
%include <complex.i>
#ifdef __cplusplus
%inline
{
std::complex<double> Conj(const std::complex<double>& a)
{
return std::conj(a);
}
std::complex<float> Conjf(const std::complex<float>& a)
{
return std::conj(a);
}
}
#else
%inline
{
complex Conj(complex a)
{
return conj(a);
}
}
#endif

View file

@ -0,0 +1,6 @@
import complextest
a = complex(1,2)
if complextest.Conj(a) != a.conjugate():
raise RuntimeError, "bad complex mapping"