File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,28 @@ BOOST_AUTO_TEST_CASE(signal_caster_basics) {
210
210
211
211
// / Unregister a type
212
212
asig_caster->unregisterCast (typeid (double ));
213
+
214
+ // / Unregister the type a second time to generate exception
215
+ bool res= false ;
216
+ try {
217
+ asig_caster->unregisterCast (typeid (double ));
218
+ } catch (ExceptionSignal &aes)
219
+ {
220
+ res = (aes.getCode () == ExceptionSignal::GENERIC);
221
+ }
222
+ BOOST_CHECK (res);
213
223
224
+ // / Get the type cast to generate exception
225
+ res= false ;
226
+ double ad=2.0 ;
227
+ output_test_stream output;
228
+ try {
229
+ asig_caster->disp (ad,output);
230
+ } catch (ExceptionSignal &aes)
231
+ {
232
+ res = (aes.getCode () == ExceptionSignal::BAD_CAST);
233
+ }
234
+ BOOST_CHECK (res);
214
235
asig_caster->destroy ();
215
236
BOOST_CHECK (true );
216
237
}
You can’t perform that action at this time.
0 commit comments