call_sv call_pv call_method eval_sv eval_pv require_pv
G_SCALAR G_ARRAY G_VOID G_DISCARD G_EVAL G_NOARGS
G_KEEPERR G_NODEBUG G_METHOD
- exception mycroak strtab
+ apitest_exception mycroak strtab
my_cxt_getint my_cxt_getsv my_cxt_setint my_cxt_setsv
sv_setsv_cow_hashkey_core sv_setsv_cow_hashkey_notcore
);
/* from exception.c */
-int exception(int);
+int apitest_exception(int);
/* from core_or_not.inc */
bool sv_setsv_cow_hashkey_core(void);
require_pv(pv);
int
-exception(throw_e)
+apitest_exception(throw_e)
int throw_e
OUTPUT:
RETVAL
croak("boo\n");
}
-int exception(int throw_e)
+/* Don't give this the same name as exection() in ext/Devel/PPPort/module3.c
+ as otherwise building entirely staticly will cause a test to fail, as
+ PPPort's execption() gets used in place of this one. */
+
+int apitest_exception(int throw_e)
{
dTHR;
dXCPT;
$XS::APItest::exception_caught = undef;
-$rv = eval { exception(0) };
+$rv = eval { apitest_exception(0) };
is($@, '');
ok(defined $rv);
is($rv, 42);
$XS::APItest::exception_caught = undef;
-$rv = eval { exception(1) };
+$rv = eval { apitest_exception(1) };
is($@, "boo\n");
ok(not defined $rv);
is($XS::APItest::exception_caught, 1);