| version 1.3, 2003/02/23 17:39:24 |
version 1.4, 2003/03/09 10:32:41 |
|
|
| if (a == COM (save)) { |
if (a == COM (save)) { |
| COX_THROW (undef); |
COX_THROW (undef); |
| } |
} |
| |
if (a == COM (destroy)) { |
| |
free (o); |
| |
} |
| return rv; |
return rv; |
| } /* }}} */ |
} /* }}} */ |
| /* {{{ */ static co_v test_obj2_msg (co o, co s, co_id_t a, va_list ap) |
/* {{{ */ static co_v test_obj2_msg (co o, co s, co_id_t a, va_list ap) |
| { |
{ |
| co_v rv; |
co_v rv; |
| rv . _int = 3; |
rv . _int = 3; |
| |
if (a == COM (destroy)) { |
| |
free (o); |
| |
} |
| return rv; |
return rv; |
| } /* }}} */ |
} /* }}} */ |
| /* {{{ */ static co test_obj1_new (void) |
/* {{{ */ static co test_obj1_new (void) |
| { |
{ |
| co_o_head_full o; |
co_o_head_full o; |
| o = new (co_o_head_full_s); |
o = new (co_o_head_full_s); |
| |
cox_pop (o); |
| CO_BLESS_M (o, test_obj1); |
CO_BLESS_M (o, test_obj1); |
| return o; |
return o; |
| } /* }}} */ |
} /* }}} */ |
|
|
| { |
{ |
| co_o_head_full o; |
co_o_head_full o; |
| o = new (co_o_head_full_s); |
o = new (co_o_head_full_s); |
| |
cox_pop (o); |
| CO_BLESS_M (o, test_obj2); |
CO_BLESS_M (o, test_obj2); |
| return o; |
return o; |
| } /* }}} */ |
} /* }}} */ |
|
|
| tst2 = CO_NEW (test_obj2); |
tst2 = CO_NEW (test_obj2); |
| if (!tst1) error (1, "test object 1 creation failed\n"); |
if (!tst1) error (1, "test object 1 creation failed\n"); |
| if (!tst2) error (1, "test object 2 creation failed\n"); |
if (!tst2) error (1, "test object 2 creation failed\n"); |
| |
cox_pop (tst2); |
| |
cox_pop (tst1); |
| |
|
| // test return status of CO_M |
// test return status of CO_M |
| if (CO_M (tst1, reload) . _int != 1) error (2, "eh\n"); |
if (CO_M (tst1, reload) . _int != 1) error (2, "eh\n"); |
|
|
| CO_CNT (tst2, ok, tst1, destroy); |
CO_CNT (tst2, ok, tst1, destroy); |
| CO_EV (tst2, ok); |
CO_EV (tst2, ok); |
| |
|
| |
//CO_M (tst1, destroy); |
| |
CO_M (super, destroy, 0); |
| |
|
| //if (CO_DESTROY (tst1)) (4, "CO_DESTROY failed\n"); |
//if (CO_DESTROY (tst1)) (4, "CO_DESTROY failed\n"); |
| //if (tst1) error (5, "CO_DESTROY did not set tst to NULL\n"); |
//if (tst1) error (5, "CO_DESTROY did not set tst to NULL\n"); |