+
+ INFO0("Called the exception raising RPC");
+ exception_catching();
+
+ /* doxygen_ignore */
+ for (i=0; i<5; i++) {
+
+ INFO1("Call the exception raising RPC (i=%d)",i);
+ TRY {
+ gras_msg_rpccall(toserver, 6000.0,
+ gras_msgtype_by_name("raise exception"), NULL, NULL);
+ } CATCH(e) {
+ gotit = 1;
+ xbt_ex_free(e);
+ }
+ if (!gotit) {
+ THROW0(unknown_error,0,"Didn't got the remote exception!");
+ }
+ }
+ /* doxygen_resume */
+
+ /* 9. Call a RPC which raises an exception (to test that exception propagation works) */
+ for (i=0;i<5;i++) {
+ INFO1("Call the exception raising RPC on the forwarder (i=%d)",i);
+ TRY {
+ gras_msg_rpccall(toforwarder, 6000.0,
+ gras_msgtype_by_name("forward exception"), NULL, NULL);
+ } CATCH(e) {
+ gotit = 1;
+ }
+ if (!gotit) {
+ THROW0(unknown_error,0,"Didn't got the remote exception!");
+ }
+ xbt_assert1(e.value == 42, "Got wrong value: %d (!=42)", e.value);
+ xbt_assert1(!strncmp(e.msg,"Some error we will catch on client side",
+ strlen("Some error we will catch on client side")),
+ "Got wrong message: %s", e.msg);
+ xbt_assert2(e.category == unknown_error,
+ "Got wrong category: %d (instead of %d)",
+ e.category,unknown_error);
+ INFO0("Got the expected exception when calling the exception raising RPC");
+ xbt_ex_free(e);
+ exception_catching();