Add catches_strings test to test throws char * typemap
This commit is contained in:
parent
034e2358f9
commit
4a29229bab
21 changed files with 286 additions and 0 deletions
19
Examples/test-suite/octave/catches_strings_runme.m
Normal file
19
Examples/test-suite/octave/catches_strings_runme.m
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# do not dump Octave core
|
||||
if exist("crash_dumps_octave_core", "builtin")
|
||||
crash_dumps_octave_core(0);
|
||||
endif
|
||||
|
||||
catches_strings
|
||||
|
||||
exception_thrown = false;
|
||||
try
|
||||
StringsThrower.charstring();
|
||||
catch e
|
||||
if (isempty(strfind(e.message, "charstring message")))
|
||||
error("incorrect exception message: %s", e.message)
|
||||
endif
|
||||
exception_thrown = true;
|
||||
end_try_catch
|
||||
if (!exception_thrown)
|
||||
error("Should have thrown an exception");
|
||||
endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue