Add catches_strings test to test throws char * typemap

This commit is contained in:
William S Fulton 2022-09-18 19:37:02 +01:00
commit 4a29229bab
21 changed files with 286 additions and 0 deletions

View 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