Skip to content
Snippets Groups Projects
Commit a919c148 authored by Olivier Stasse's avatar Olivier Stasse
Browse files

Add tests/signal-all.cpp

parent d5039779
No related branches found
No related tags found
No related merge requests found
......@@ -210,7 +210,28 @@ BOOST_AUTO_TEST_CASE(signal_caster_basics) {
/// Unregister a type
asig_caster->unregisterCast(typeid(double));
/// Unregister the type a second time to generate exception
bool res= false;
try {
asig_caster->unregisterCast(typeid(double));
} catch (ExceptionSignal &aes)
{
res = (aes.getCode() == ExceptionSignal::GENERIC);
}
BOOST_CHECK(res);
/// Get the type cast to generate exception
res= false;
double ad=2.0;
output_test_stream output;
try {
asig_caster->disp(ad,output);
} catch (ExceptionSignal &aes)
{
res = (aes.getCode() == ExceptionSignal::BAD_CAST);
}
BOOST_CHECK(res);
asig_caster->destroy();
BOOST_CHECK(true);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment