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
18
Examples/test-suite/tcl/catches_strings_runme.tcl
Normal file
18
Examples/test-suite/tcl/catches_strings_runme.tcl
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
if [ catch { load ./catches_strings[info sharedlibextension] catches_strings} err_msg ] {
|
||||
puts stderr "Could not load shared object:\n$err_msg"
|
||||
}
|
||||
|
||||
|
||||
set exception_thrown 0
|
||||
if [ catch {
|
||||
StringsThrower_charstring
|
||||
} e ] {
|
||||
if {[string first "charstring message" $e] == -1} {
|
||||
error "incorrect exception message: $e"
|
||||
}
|
||||
set exception_thrown 1
|
||||
}
|
||||
if {!$exception_thrown} {
|
||||
error "Should have thrown an exception"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue