From: <vin...@us...> - 2011-01-28 13:14:39
|
Revision: 12402 http://swig.svn.sourceforge.net/swig/?rev=12402&view=rev Author: vincentcouvert Date: 2011-01-28 13:14:32 +0000 (Fri, 28 Jan 2011) Log Message: ----------- Add tests + small modifications Modified Paths: -------------- branches/gsoc2009-sploving/Lib/scilab/sciprimtypes.swg branches/gsoc2009-sploving/Lib/scilab/scitypemaps.swg Added Paths: ----------- branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_inherit_ok_runme.sci branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_inherit_runme.sci branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_signature_runme.sci branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_typedef2_runme.sci branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_typedef_runme.sci branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_virtual_runme.sci branches/gsoc2009-sploving/Examples/test-suite/scilab/access_change_runme.sci branches/gsoc2009-sploving/Examples/test-suite/scilab/add_link_runme.sci branches/gsoc2009-sploving/Examples/test-suite/scilab/allowexcept_runme.sci branches/gsoc2009-sploving/Examples/test-suite/scilab/anonymous_bitfield_runme.sci Added: branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_inherit_ok_runme.sci =================================================================== --- branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_inherit_ok_runme.sci (rev 0) +++ branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_inherit_ok_runme.sci 2011-01-28 13:14:32 UTC (rev 12402) @@ -0,0 +1,11 @@ +exec("swigtest.start", -1); + +try + Spam = new_Spam() +catch + swigtesterror(); +end + +if Foo_blah(Spam)<>0 then swigtesterror; end + +exec("swigtest.quit", -1); Added: branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_inherit_runme.sci =================================================================== --- branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_inherit_runme.sci (rev 0) +++ branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_inherit_runme.sci 2011-01-28 13:14:32 UTC (rev 12402) @@ -0,0 +1,10 @@ +exec("swigtest.start", -1); + +try + // This call must fail because the constructor does not exist + Spam = new_Spam() + swigtesterror(); +catch +end + +exec("swigtest.quit", -1); Added: branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_signature_runme.sci =================================================================== --- branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_signature_runme.sci (rev 0) +++ branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_signature_runme.sci 2011-01-28 13:14:32 UTC (rev 12402) @@ -0,0 +1,17 @@ +exec("swigtest.start", -1); + +try + // This call must fail + abstract_foo_meth(1); + swigtesterror(); +catch +end + +try + // This call must fail + abstract_bar_meth(1); + swigtesterror(); +catch +end + +exec("swigtest.quit", -1); Added: branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_typedef2_runme.sci =================================================================== --- branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_typedef2_runme.sci (rev 0) +++ branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_typedef2_runme.sci 2011-01-28 13:14:32 UTC (rev 12402) @@ -0,0 +1,15 @@ +exec("swigtest.start", -1); + +try + a = new_A_UF(); +catch + swigtesterror(); +end + +try + delete_A_UF(a); +catch + swigtesterror(); +end + +exec("swigtest.quit", -1); Added: branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_typedef_runme.sci =================================================================== --- branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_typedef_runme.sci (rev 0) +++ branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_typedef_runme.sci 2011-01-28 13:14:32 UTC (rev 12402) @@ -0,0 +1,17 @@ +exec("swigtest.start", -1); + +try + e = new_Engine(); +catch + swigtesterror(); +end + +try + a = new_A(); +catch + swigtesterror(); +end + +// TODO: test write method + +exec("swigtest.quit", -1); Added: branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_virtual_runme.sci =================================================================== --- branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_virtual_runme.sci (rev 0) +++ branches/gsoc2009-sploving/Examples/test-suite/scilab/abstract_virtual_runme.sci 2011-01-28 13:14:32 UTC (rev 12402) @@ -0,0 +1,27 @@ +exec("swigtest.start", -1); + +try + d = new_D(); +catch + swigtesterror(); +end + +try + delete_D(d); +catch + swigtesterror(); +end + +try + e = new_E(); +catch + swigtesterror(); +end + +try + delete_E(e); +catch + swigtesterror(); +end + +exec("swigtest.quit", -1); Added: branches/gsoc2009-sploving/Examples/test-suite/scilab/access_change_runme.sci =================================================================== --- branches/gsoc2009-sploving/Examples/test-suite/scilab/access_change_runme.sci (rev 0) +++ branches/gsoc2009-sploving/Examples/test-suite/scilab/access_change_runme.sci 2011-01-28 13:14:32 UTC (rev 12402) @@ -0,0 +1,39 @@ +exec("swigtest.start", -1); + +try + baseInt = new_BaseInt(); +catch + swigtesterror(); +end + +try + delete_BaseInt(baseInt); +catch + swigtesterror(); +end + +try + derivedInt = new_DerivedInt(); +catch + swigtesterror(); +end + +try + delete_DerivedInt(derivedInt); +catch + swigtesterror(); +end + +try + bottomInt = new_BottomInt(); +catch + swigtesterror(); +end + +try + delete_BottomInt(bottomInt); +catch + swigtesterror(); +end + +exec("swigtest.quit", -1); Added: branches/gsoc2009-sploving/Examples/test-suite/scilab/add_link_runme.sci =================================================================== --- branches/gsoc2009-sploving/Examples/test-suite/scilab/add_link_runme.sci (rev 0) +++ branches/gsoc2009-sploving/Examples/test-suite/scilab/add_link_runme.sci 2011-01-28 13:14:32 UTC (rev 12402) @@ -0,0 +1,27 @@ +exec("swigtest.start", -1); + +try + foo = new_Foo(); +catch + swigtesterror(); +end + +try + foo2 = Foo_blah(foo); +catch + swigtesterror(); +end + +try + delete_Foo(foo); +catch + swigtesterror(); +end + +try + delete_Foo(foo2); +catch + swigtesterror(); +end + +exec("swigtest.quit", -1); Added: branches/gsoc2009-sploving/Examples/test-suite/scilab/allowexcept_runme.sci =================================================================== --- branches/gsoc2009-sploving/Examples/test-suite/scilab/allowexcept_runme.sci (rev 0) +++ branches/gsoc2009-sploving/Examples/test-suite/scilab/allowexcept_runme.sci 2011-01-28 13:14:32 UTC (rev 12402) @@ -0,0 +1,5 @@ +exec("swigtest.start", -1); + +// TODO: add tests here + +exec("swigtest.quit", -1); Added: branches/gsoc2009-sploving/Examples/test-suite/scilab/anonymous_bitfield_runme.sci =================================================================== --- branches/gsoc2009-sploving/Examples/test-suite/scilab/anonymous_bitfield_runme.sci (rev 0) +++ branches/gsoc2009-sploving/Examples/test-suite/scilab/anonymous_bitfield_runme.sci 2011-01-28 13:14:32 UTC (rev 12402) @@ -0,0 +1,65 @@ +exec("swigtest.start", -1); + +try + foo = new_Foo(); +catch + swigtesterror(); +end + +if Foo_x_get(foo)<>0 then swigtesterror(); end +if typeof(Foo_x_get(foo))<>"constant" then swigtesterror(); end + +if Foo_y_get(foo)<>0 then swigtesterror(); end +if typeof(Foo_y_get(foo))<>"constant" then swigtesterror(); end + +if Foo_z_get(foo)<>0 then swigtesterror(); end +if typeof(Foo_z_get(foo))<>"constant" then swigtesterror(); end + +if Foo_f_get(foo)<>uint32(0) then swigtesterror(); end +if typeof(Foo_f_get(foo))<>"uint32" then swigtesterror(); end + +if Foo_seq_get(foo)<>uint32(0) then swigtesterror(); end +if typeof(Foo_seq_get(foo))<>"uint32" then swigtesterror(); end + +try + Foo_x_set(foo, 5); +catch + swigtesterror(); +end +if Foo_x_get(foo)<>5 then swigtesterror(); end + +try + Foo_y_set(foo, 5); +catch + swigtesterror(); +end +if Foo_y_get(foo)<>5 then swigtesterror(); end + +try + Foo_f_set(foo, 5); +catch + swigtesterror(); +end +if Foo_y_get(foo)<>uint32(5) then swigtesterror(); end + +try + Foo_z_set(foo, 13); +catch + swigtesterror(); +end +if Foo_z_get(foo)<>13 then swigtesterror(); end + +try + Foo_seq_set(foo, 3); +catch + swigtesterror(); +end +if Foo_seq_get(foo)<>uint32(3) then swigtesterror(); end + +try + delete_Foo(foo); +catch + swigtesterror(); +end + +exec("swigtest.quit", -1); Modified: branches/gsoc2009-sploving/Lib/scilab/sciprimtypes.swg =================================================================== --- branches/gsoc2009-sploving/Lib/scilab/sciprimtypes.swg 2011-01-28 08:59:37 UTC (rev 12401) +++ branches/gsoc2009-sploving/Lib/scilab/sciprimtypes.swg 2011-01-28 13:14:32 UTC (rev 12402) @@ -79,6 +79,13 @@ } } +%fragment(SWIG_From_frag(long),"header") { + SWIGINTERNINLINE int SWIG_From_dec(long) (long value) + { + return 0; + } +} + /*%fragment(SWIG_AsPtr_frag(std::string),"header") { SWIGINTERN int SWIG_AsPtr_std_string(int iPos, std::string **val) Modified: branches/gsoc2009-sploving/Lib/scilab/scitypemaps.swg =================================================================== --- branches/gsoc2009-sploving/Lib/scilab/scitypemaps.swg 2011-01-28 08:59:37 UTC (rev 12401) +++ branches/gsoc2009-sploving/Lib/scilab/scitypemaps.swg 2011-01-28 13:14:32 UTC (rev 12402) @@ -568,7 +568,7 @@ iRowsOut = 1; iColsOut = 1; - sciErr = SCIAPIFUNCTION(pvApiCtx, iVarOut, iRowsOut, iColsOut, (CTYPE *)&$result); + sciErr = SCIAPIFUNCTION(pvApiCtx, iVarOut, iRowsOut, iColsOut, (CTYPE *)&$1); if (sciErr.iErr) { printError(&sciErr, 0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |