Adjust for the elimination of the "float" and "complex" types.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12487 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Ian Lance Taylor 2011-02-19 20:22:33 +00:00
commit 21ca5a854c
17 changed files with 76 additions and 77 deletions

View file

@ -6,9 +6,9 @@ func main() {
defaults1 := NewDefaults1(1000)
defaults1 = NewDefaults1()
if defaults1.Ret(float64(10.0)) != 10.0 {
println(1, defaults1.Ret(float64(10.0)))
panic(defaults1.Ret(float64(10.0)))
if defaults1.Ret(10.0) != 10.0 {
println(1, defaults1.Ret(10.0))
panic(defaults1.Ret(10.0))
}
if defaults1.Ret() != -1.0 {
@ -19,8 +19,8 @@ func main() {
defaults2 := NewDefaults2(1000)
defaults2 = NewDefaults2()
if defaults2.Ret(float64(10.0)) != 10.0 {
panic(defaults2.Ret(float64(10.0)))
if defaults2.Ret(10.0) != 10.0 {
panic(defaults2.Ret(10.0))
}
if defaults2.Ret() != -1.0 {

View file

@ -12,7 +12,7 @@ func main() {
foo.Spam(1, 1)
foo.Spam(1, 1, 1)
foo.Spam(extend_placement.NewFoo())
foo.Spam(extend_placement.NewFoo(), float64(1.0))
foo.Spam(extend_placement.NewFoo(), 1.0)
bar := extend_placement.NewBar()
bar = extend_placement.NewBar(1)
@ -22,7 +22,7 @@ func main() {
bar.Spam(1, 1)
bar.Spam(1, 1, 1)
bar.Spam(extend_placement.NewBar())
bar.Spam(extend_placement.NewBar(), float64(1.0))
bar.Spam(extend_placement.NewBar(), 1.0)
footi := extend_placement.NewFooTi()
footi = extend_placement.NewFooTi(1)
@ -33,7 +33,7 @@ func main() {
footi.Spam(1, 1)
footi.Spam(1, 1, 1)
footi.Spam(extend_placement.NewFoo())
footi.Spam(extend_placement.NewFoo(), float64(1.0))
footi.Spam(extend_placement.NewFoo(), 1.0)
barti := extend_placement.NewBarTi()
barti = extend_placement.NewBarTi(1)
@ -43,5 +43,5 @@ func main() {
barti.Spam(1, 1)
barti.Spam(1, 1, 1)
barti.Spam(extend_placement.NewBar())
barti.Spam(extend_placement.NewBar(), float64(1.0))
barti.Spam(extend_placement.NewBar(), 1.0)
}

View file

@ -38,8 +38,8 @@ func main() {
panic(0)
}
friends.Set(di, float64(4.0))
friends.Set(dd, float64(1.3))
friends.Set(di, 4.0)
friends.Set(dd, 1.3)
if friends.Get_val1(di).(float64) != 4 {
panic(0)

View file

@ -51,7 +51,7 @@ func main() {
panic(0)
}
c := cmplx(float64(2), float64(3))
c := complex(2, 3)
r := real(c)
if Ctest1(c) != r {

View file

@ -16,7 +16,7 @@ func main() {
if f.Test(float64(3), float64(2)).(float64) != 5 {
panic(0)
}
if f.Test(float64(3.0)).(float64) != 1003 {
if f.Test(3.0).(float64) != 1003 {
panic(0)
}
}

View file

@ -10,7 +10,7 @@ func main() {
if f.Test("hello") != 2 {
panic(0)
}
if f.Test(float64(3.5), float64(2.5)) != 3 {
if f.Test(3.5, 2.5) != 3 {
panic(0)
}
if f.Test("hello", 20) != 1020 {

View file

@ -7,7 +7,7 @@ func main() {
panic("foo(int)")
}
if Foo(float64(3.0)) != "foo:double" {
if Foo(3.0) != "foo:double" {
panic("foo(double)")
}
@ -37,7 +37,7 @@ func main() {
panic("Spam::foo(int)")
}
if s.Foo(float64(3.0)) != "foo:double" {
if s.Foo(3.0) != "foo:double" {
panic("Spam::foo(double)")
}
@ -61,7 +61,7 @@ func main() {
panic("Spam::bar(int)")
}
if SpamBar(float64(3.0)) != "bar:double" {
if SpamBar(3.0) != "bar:double" {
panic("Spam::bar(double)")
}
@ -93,7 +93,7 @@ func main() {
panic("Spam(int)")
}
s = NewSpam(float64(3.4))
s = NewSpam(3.4)
if s.GetXtype() != "double" {
panic("Spam(double)")
}

View file

@ -6,18 +6,18 @@ func main() {
_ = Foo()
_ = Maximum(3, 4)
_ = Maximum(float64(3.4), float64(5.2))
_ = Maximum(3.4, 5.2)
// mix 1
if Mix1("hi") != 101 {
panic("mix1(const char*)")
}
if Mix1(float64(1.0), float64(1.0)) != 102 {
if Mix1(1.0, 1.0) != 102 {
panic("mix1(double, const double &)")
}
if Mix1(float64(1.0)) != 103 {
if Mix1(1.0) != 103 {
panic("mix1(double)")
}
@ -26,11 +26,11 @@ func main() {
panic("mix2(const char*)")
}
if Mix2(float64(1.0), float64(1.0)) != 102 {
if Mix2(1.0, 1.0) != 102 {
panic("mix2(double, const double &)")
}
if Mix2(float64(1.0)) != 103 {
if Mix2(1.0) != 103 {
panic("mix2(double)")
}
@ -39,11 +39,11 @@ func main() {
panic("mix3(const char*)")
}
if Mix3(float64(1.0), float64(1.0)) != 102 {
if Mix3(1.0, 1.0) != 102 {
panic("mix3(double, const double &)")
}
if Mix3(float64(1.0)) != 103 {
if Mix3(1.0) != 103 {
panic("mix3(double)")
}
@ -52,12 +52,12 @@ func main() {
panic("overtparams1(int)")
}
if Overtparams1(float64(100.0), 100) != 20 {
if Overtparams1(100.0, 100) != 20 {
panic("overtparams1(double, int)")
}
// Combination 2
if Overtparams2(float64(100.0), 100) != 40 {
if Overtparams2(100.0, 100) != 40 {
panic("overtparams2(double, int)")
}
@ -66,7 +66,7 @@ func main() {
panic("overloaded()")
}
if Overloaded(float64(100.0), 100) != 70 {
if Overloaded(100.0, 100) != 70 {
panic("overloaded(double, int)")
}
@ -84,7 +84,7 @@ func main() {
panic("specialization(int)")
}
if Specialization(float64(10.0)) != 203 {
if Specialization(10.0) != 203 {
panic("specialization(double)")
}
@ -92,7 +92,7 @@ func main() {
panic("specialization(int, int)")
}
if Specialization(float64(10.0), float64(10.0)) != 205 {
if Specialization(10.0, 10.0) != 205 {
panic("specialization(double, double)")
}
@ -135,7 +135,7 @@ func main() {
panic("overload(Klass t, const char *)")
}
if Overload(float64(10.0), "hi") != 40 {
if Overload(10.0, "hi") != 40 {
panic("overload(double t, const char *)")
}
@ -173,7 +173,7 @@ func main() {
panic("nsoverload(Klass t, const char *)")
}
if Nsoverload(float64(10.0), "hi") != 1040 {
if Nsoverload(10.0, "hi") != 1040 {
panic("nsoverload(double t, const char *)")
}

View file

@ -6,18 +6,18 @@ func main() {
_ = Foo()
_ = Maximum(3, 4)
_ = Maximum(float64(3.4), float64(5.2))
_ = Maximum(3.4, 5.2)
// mix 1
if Mix1("hi") != 101 {
panic("mix1(const char*)")
}
if Mix1(float64(1.0), float64(1.0)) != 102 {
if Mix1(1.0, 1.0) != 102 {
panic("mix1(double, const double &)")
}
if Mix1(float64(1.0)) != 103 {
if Mix1(1.0) != 103 {
panic("mix1(double)")
}
@ -26,11 +26,11 @@ func main() {
panic("mix2(const char*)")
}
if Mix2(float64(1.0), float64(1.0)) != 102 {
if Mix2(1.0, 1.0) != 102 {
panic("mix2(double, const double &)")
}
if Mix2(float64(1.0)) != 103 {
if Mix2(1.0) != 103 {
panic("mix2(double)")
}
@ -39,11 +39,11 @@ func main() {
panic("mix3(const char*)")
}
if Mix3(float64(1.0), float64(1.0)) != 102 {
if Mix3(1.0, 1.0) != 102 {
panic("mix3(double, const double &)")
}
if Mix3(float64(1.0)) != 103 {
if Mix3(1.0) != 103 {
panic("mix3(double)")
}
@ -52,12 +52,12 @@ func main() {
panic("overtparams1(int)")
}
if Overtparams1(float64(100.0), 100) != 20 {
if Overtparams1(100.0, 100) != 20 {
panic("overtparams1(double, int)")
}
// Combination 2
if Overtparams2(float64(100.0), 100) != 40 {
if Overtparams2(100.0, 100) != 40 {
panic("overtparams2(double, int)")
}
@ -66,7 +66,7 @@ func main() {
panic("overloaded()")
}
if Overloaded(float64(100.0), 100) != 70 {
if Overloaded(100.0, 100) != 70 {
panic("overloaded(double, int)")
}
@ -84,7 +84,7 @@ func main() {
panic("specialization(int)")
}
if Specialization(float64(10.0)) != 203 {
if Specialization(10.0) != 203 {
panic("specialization(double)")
}
@ -92,7 +92,7 @@ func main() {
panic("specialization(int, int)")
}
if Specialization(float64(10.0), float64(10.0)) != 205 {
if Specialization(10.0, 10.0) != 205 {
panic("specialization(double, double)")
}
@ -136,7 +136,7 @@ func main() {
panic("overload(Klass t, const char *)")
}
if Overload(float64(10.0), "hi") != 40 {
if Overload(10.0, "hi") != 40 {
panic("overload(double t, const char *)")
}
@ -174,7 +174,7 @@ func main() {
panic("nsoverload(Klass t, const char *)")
}
if Nsoverload(float64(10.0), "hi") != 1040 {
if Nsoverload(10.0, "hi") != 1040 {
panic("nsoverload(double t, const char *)")
}

View file

@ -9,7 +9,7 @@ func main() {
if f.Test(3) != 1 {
panic(0)
}
if f.Test(float64(3.5)) != 2 {
if f.Test(3.5) != 2 {
panic(0)
}
if f.Test("hello") != 3 {
@ -19,7 +19,7 @@ func main() {
if b.Test(3) != 1 {
panic(0)
}
if b.Test(float64(3.5)) != 2 {
if b.Test(3.5) != 2 {
panic(0)
}
if b.Test("hello") != 3 {

View file

@ -7,7 +7,7 @@ func main() {
helloInt.Foo(template_default_arg.Hello_intHi)
x := template_default_arg.NewX_int()
if x.Meth(float64(20.0), 200).(int) != 200 {
if x.Meth(20.0, 200).(int) != 200 {
panic("X_int test 1 failed")
}
if x.Meth(20).(int) != 20 {
@ -18,7 +18,7 @@ func main() {
}
y := template_default_arg.NewY_unsigned()
if y.Meth(float64(20.0), uint(200)).(uint) != 200 {
if y.Meth(20.0, uint(200)).(uint) != 200 {
panic("Y_unsigned test 1 failed")
}
if y.Meth(uint(20)).(uint) != 20 {
@ -29,19 +29,19 @@ func main() {
}
_ = template_default_arg.NewX_longlong()
_ = template_default_arg.NewX_longlong(float64(20.0))
_ = template_default_arg.NewX_longlong(float64(20.0), int64(200))
_ = template_default_arg.NewX_longlong(20.0)
_ = template_default_arg.NewX_longlong(20.0, int64(200))
_ = template_default_arg.NewX_int()
_ = template_default_arg.NewX_int(float64(20.0))
_ = template_default_arg.NewX_int(float64(20.0), 200)
_ = template_default_arg.NewX_int(20.0)
_ = template_default_arg.NewX_int(20.0, 200)
_ = template_default_arg.NewX_hello_unsigned()
_ = template_default_arg.NewX_hello_unsigned(float64(20.0))
_ = template_default_arg.NewX_hello_unsigned(float64(20.0), template_default_arg.NewHello_int())
_ = template_default_arg.NewX_hello_unsigned(20.0)
_ = template_default_arg.NewX_hello_unsigned(20.0, template_default_arg.NewHello_int())
yy := template_default_arg.NewY_hello_unsigned()
yy.Meth(float64(20.0), template_default_arg.NewHello_int())
yy.Meth(20.0, template_default_arg.NewHello_int())
yy.Meth(template_default_arg.NewHello_int())
yy.Meth()
@ -97,7 +97,7 @@ func main() {
}
// %template(ott) ott<double>
if template_default_arg.Ott(template_default_arg.NewHello_int(), float64(1.0)) != 60 {
if template_default_arg.Ott(template_default_arg.NewHello_int(), 1.0) != 60 {
panic("ott test 12 failed")
}

View file

@ -13,7 +13,7 @@ func main() {
panic(0)
}
p3 := NewPairdd(float64(3.5), float64(2.5))
p3 := NewPairdd(3.5, 2.5)
p4 := NewPairdd(p3)
if p4.GetFirst() != 3.5 {

View file

@ -8,7 +8,7 @@ func main() {
panic("FooBar::blah(int)")
}
if f.Blah(float64(3.5)).(float64) != 3.5 {
if f.Blah(3.5) != 3.5 {
panic("FooBar::blah(double)")
}
@ -21,7 +21,7 @@ func main() {
panic("FooBar2::blah(int)")
}
if f2.Blah(float64(3.5)).(float64) != 3.5 {
if f2.Blah(3.5) != 3.5 {
panic("FooBar2::blah(double)")
}
@ -34,7 +34,7 @@ func main() {
panic("FooBar3::blah(int)")
}
if f3.Blah(float64(3.5)).(float64) != 3.5 {
if f3.Blah(3.5) != 3.5 {
panic("FooBar3::blah(double)")
}

View file

@ -8,7 +8,7 @@ func main() {
panic("blah(int)")
}
if f.Blah(float64(3.5)).(float64) != 3.5 {
if f.Blah(3.5) != 3.5 {
panic("blah(double)")
}
@ -20,7 +20,7 @@ func main() {
panic("blah(int,int)")
}
if f.Blah(float64(3.5), float64(7.5)).(float64) != (3.5 + 7.5) {
if f.Blah(3.5, 7.5) != (3.5 + 7.5) {
panic("blah(double,double)")
}

View file

@ -8,7 +8,7 @@ func main() {
panic("Bar::test(int)")
}
if b.Test(float64(3.5)).(float64) != 3.5 {
if b.Test(3.5).(float64) != 3.5 {
panic("Bar::test(double)")
}
@ -17,7 +17,7 @@ func main() {
panic("Bar2::test(int)")
}
if b2.Test(float64(3.5)).(float64) != 7.0 {
if b2.Test(3.5).(float64) != 7.0 {
panic("Bar2::test(double)")
}
@ -26,7 +26,7 @@ func main() {
panic("Bar3::test(int)")
}
if b3.Test(float64(3.5)).(float64) != 7.0 {
if b3.Test(3.5).(float64) != 7.0 {
panic("Bar3::test(double)")
}
@ -35,7 +35,7 @@ func main() {
panic("Bar4::test(int)")
}
if b4.Test(float64(3.5)).(float64) != 7.0 {
if b4.Test(3.5).(float64) != 7.0 {
panic("Bar4::test(double)")
}
@ -44,7 +44,7 @@ func main() {
panic("Fred1::test(int)")
}
if bf1.Test(float64(3.5)).(float64) != 7.0 {
if bf1.Test(3.5).(float64) != 7.0 {
panic("Fred1::test(double)")
}
@ -53,7 +53,7 @@ func main() {
panic("Fred2::test(int)")
}
if bf2.Test(float64(3.5)).(float64) != 7.0 {
if bf2.Test(3.5).(float64) != 7.0 {
panic("Fred2::test(double)")
}
}