scilab: implement & fix throw_exception test
This commit is contained in:
parent
1c207f76d0
commit
7bc8201719
3 changed files with 46 additions and 10 deletions
27
Examples/test-suite/scilab/throw_exception_runme.sci
Normal file
27
Examples/test-suite/scilab/throw_exception_runme.sci
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
exec("swigtest.start", -1);
|
||||
|
||||
foo = new_Foo();
|
||||
|
||||
ierr = execstr("Foo_test_int(foo)", 'errcatch');
|
||||
checkequal(ierr, 999, "Foo_test_int(foo): ierr");
|
||||
checkequal(lasterror(), "Exception (int) occured: 37", "Foo_test_int(foo): msg");
|
||||
|
||||
ierr = execstr("Foo_test_msg(foo)", 'errcatch');
|
||||
checkequal(ierr, 999, "Foo_test_msg(foo): ierr");
|
||||
checkequal(lasterror(), "Exception (char const *) occured: Dead", "Foo_test_msg(foo): msg");
|
||||
|
||||
ierr = execstr("Foo_test_multi(foo, 1)", 'errcatch');
|
||||
checkequal(ierr, 999, "Foo_test_multi(foo, 1): ierr");
|
||||
checkequal(lasterror(), "Exception (int) occured: 37", "Foo_test_multi(foo, 1): msg");
|
||||
|
||||
ierr = execstr("Foo_test_multi(foo, 2)", 'errcatch');
|
||||
checkequal(ierr, 999, "Foo_test_multi(foo, 2): ierr");
|
||||
checkequal(lasterror(), "Exception (char const *) occured: Dead", "Foo_test_multi(foo, 2): msg");
|
||||
|
||||
ierr = execstr("Foo_test_cls(foo)", 'errcatch');
|
||||
checkequal(ierr, 998, "Foo_test_cls(foo): ierr");
|
||||
checkequal(lasterror(), "Exception (Error) occured.", "Foo_test_cls(foo): msg");
|
||||
|
||||
delete_Foo(foo);
|
||||
|
||||
exec("swigtest.quit", -1);
|
||||
Loading…
Add table
Add a link
Reference in a new issue