Show
Ignore:
Timestamp:
07/04/08 15:39:24 (5 months ago)
Author:
ruoso
Message:

[SMOP] YAY! p6opaque succesfully delegates the methods to the metaclass... including the DESTROYALL call...

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • v6/smop/test/12_p6opaque.sm0p

    r21216 r21218  
    1111                                  SMOP__Object* capture) { 
    1212  if (identifier == SMOP__ID__dispatch) { 
    13     printf("ok 3 - called dispatch\n"); 
     13    SMOP__Object* called = SMOP__NATIVE__capture_positional(interpreter,capture,1); 
     14    if (called == SMOP__ID__STORE) { 
     15      printf("ok 3 - called dispatch\n"); 
     16    } else if (called == SMOP__ID__DESTROYALL) { 
     17      printf("ok 4 - called DESTROYALL on the metaclass\n"); 
     18    } else { 
     19      printf("not ok - unkown method to dispatch\n"); 
     20    } 
     21    SMOP_RELEASE(interpreter, called); 
    1422    SMOP_RELEASE(interpreter, capture); 
    1523  } else if (identifier == SMOP__ID__DESTROYALL) { 
     
    2533                                  SMOP__ResponderInterface* responder, 
    2634                                  SMOP__Object* obj) { 
    27   printf("-"); 
    2835  smop_lowlevel_refcnt_dec(interpreter, responder, obj); 
    2936  return obj; 
     
    3340                                    SMOP__ResponderInterface* responder, 
    3441                                    SMOP__Object* obj) { 
    35   printf("+"); 
    3642  smop_lowlevel_refcnt_inc(interpreter, responder, obj); 
    3743  return obj; 
     
    4147  smop_init(); 
    4248 
    43   printf("1..6\n"); 
     49  printf("1..7\n"); 
    4450 
    4551 
     
    6470    $p6opaque.SMOP__ID__REPR_how($how); 
    6571    $p6opaque.SMOP__ID__STORE(); 
     72    SMOP__SLIME__CurrentFrame.forget(); 
    6673  }; 
    6774 
     
    7582  printf("ok 2 - goto frame.\n"); 
    7683 
     84  printf("# before freeing how\n"); 
     85  SMOP_RELEASE(interpreter,how); 
     86 
     87  printf("# before freeing p6opaque\n"); 
     88  SMOP_RELEASE(interpreter,p6opaque); 
     89 
    7790  SMOP_DISPATCH(interpreter, SMOP_RI(interpreter), 
    7891                SMOP__ID__loop, SMOP__NATIVE__capture_create(interpreter, 
     
    8194                                                             NULL, NULL)); 
    8295 
    83   printf("ok 5 - interpreter loop.\n"); 
     96  printf("ok 6 - interpreter loop.\n"); 
    8497 
    85   SMOP_RELEASE(SMOP__INTPTR__InterpreterInstance,how); 
    86   SMOP_RELEASE(SMOP__INTPTR__InterpreterInstance,p6opaque); 
     98  printf("# before freeing the interpreter\n"); 
    8799  SMOP_RELEASE(SMOP__INTPTR__InterpreterInstance,interpreter); 
    88100 
    89   printf("ok 6 - Scalar destroyed should free the p6opaque object also.\n"); 
     101  printf("ok 7 - Scalar destroyed should free the p6opaque object also.\n"); 
    90102 
    91103  smop_destr();