mirror of https://github.com/swig/swig
Duplicate tests that are run twice as both C and C++ tests to fix parallel make: overload_extend
This commit is contained in:
parent
0bd41dc14d
commit
155e31626c
|
@ -0,0 +1,2 @@
|
|||
(load "overload_extend_c.so")
|
||||
(include "../schemerunme/overload_extend_c.scm")
|
|
@ -631,7 +631,7 @@ C_TEST_CASES += \
|
|||
nested_extend_c \
|
||||
nested_structs \
|
||||
newobject2 \
|
||||
overload_extend \
|
||||
overload_extend_c \
|
||||
overload_extend2 \
|
||||
preproc \
|
||||
preproc_constants_c \
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package main
|
||||
|
||||
import "./overload_extend_c"
|
||||
|
||||
func main() {
|
||||
f := overload_extend_c.NewFoo()
|
||||
if f.Test().(int) != 0 {
|
||||
panic(0)
|
||||
}
|
||||
if f.Test(3).(int) != 1 {
|
||||
panic(0)
|
||||
}
|
||||
if f.Test("hello").(int) != 2 {
|
||||
panic(0)
|
||||
}
|
||||
if f.Test(float64(3), float64(2)).(float64) != 5 {
|
||||
panic(0)
|
||||
}
|
||||
if f.Test(3.0).(float64) != 1003 {
|
||||
panic(0)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
(dynamic-call "scm_init_overload_extend_c_module" (dynamic-link "./liboverload_extend_c"))
|
||||
(load "../schemerunme/overload_extend_c.scm")
|
|
@ -0,0 +1,19 @@
|
|||
overload_extend_c
|
||||
|
||||
f = overload_extend_c.Foo();
|
||||
if (f.test() != 0)
|
||||
error
|
||||
endif
|
||||
if (f.test(3) != 1)
|
||||
error
|
||||
endif
|
||||
if (f.test("hello") != 2)
|
||||
error
|
||||
endif
|
||||
if (f.test(3,2) != 5)
|
||||
error
|
||||
endif
|
||||
if (f.test(3.1)-.1 != 1003) # :)
|
||||
error
|
||||
endif
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
%module overload_extend_c
|
||||
|
||||
%include "overload_extend.i"
|
|
@ -0,0 +1,13 @@
|
|||
import overload_extend_c
|
||||
|
||||
f = overload_extend_c.Foo()
|
||||
if f.test() != 0:
|
||||
raise RuntimeError
|
||||
if f.test(3) != 1:
|
||||
raise RuntimeError
|
||||
if f.test("hello") != 2:
|
||||
raise RuntimeError
|
||||
if f.test(3, 2) != 5:
|
||||
raise RuntimeError
|
||||
if f.test(3.0) != 1003:
|
||||
raise RuntimeError
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env ruby
|
||||
#
|
||||
# Put description here
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
require 'swig_assert'
|
||||
|
||||
require 'overload_extend_c'
|
||||
|
||||
f = Overload_extend_c::Foo.new
|
||||
|
||||
raise RuntimeError if f.test(3) != 1
|
||||
raise RuntimeError if f.test("hello") != 2
|
||||
raise RuntimeError if f.test(3.5,2.5) != 6
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
(define f (new-Foo))
|
||||
|
||||
(if (not (= (Foo-test f 3) 1))
|
||||
(error "test integer bad"))
|
||||
|
||||
(if (not (= (Foo-test f "hello") 2))
|
||||
(error "test string bad"))
|
||||
|
||||
(if (not (= (Foo-test f 3.5 2.5) 6.0))
|
||||
(error "test reals bad"))
|
||||
|
||||
(exit 0)
|
|
@ -0,0 +1,13 @@
|
|||
exec("swigtest.start", -1);
|
||||
|
||||
//try
|
||||
// x = new_Foo();
|
||||
//catch
|
||||
// swigtesterror();
|
||||
//end
|
||||
//if Foo_test(x) <> 0 then swigtesterror(); end
|
||||
//if Foo_test(x, 1) <> 1 then swigtesterror(); end
|
||||
//if Foo_test(x, 2, 3) <> 5 then swigtesterror(); end
|
||||
//if Foo_test(x, "Hello, swig!") <> 2 then swigtesterror(); end
|
||||
|
||||
exec("swigtest.quit", -1);
|
Loading…
Reference in New Issue