Go, Guile, Racket, Scilab: Add throws typemaps for std::string so that thrown string exception messages can be seen. Test all language for std::string throws typemaps
21 lines
650 B
Python
21 lines
650 B
Python
from catches_strings import *
|
|
|
|
exception_thrown = False
|
|
try:
|
|
StringsThrower.charstring()
|
|
except RuntimeError as e:
|
|
if "charstring message" not in str(e):
|
|
raise RuntimeError("incorrect exception message:" + str(e))
|
|
exception_thrown = True
|
|
if not exception_thrown:
|
|
raise RuntimeError("Should have thrown an exception")
|
|
|
|
exception_thrown = False
|
|
try:
|
|
StringsThrower.stdstring()
|
|
except RuntimeError as e:
|
|
if "stdstring message" not in str(e):
|
|
raise RuntimeError("incorrect exception message:" + str(e))
|
|
exception_thrown = True
|
|
if not exception_thrown:
|
|
raise RuntimeError("Should have thrown an exception")
|