Ignore:
Timestamp:
Jan 7, 2006 6:44:25 PM (18 years ago)
Author:
bennylp
Message:

Added test functions for UAC transaction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/test-pjsip/txdata_test.c

    r107 r109  
    2424#define HFIND(msg,h,H) ((pjsip_##h##_hdr*) pjsip_msg_find_hdr(msg, PJSIP_H_##H, NULL)) 
    2525 
     26#define THIS_FILE   "txdata_test.c" 
     27 
     28 
    2629/* 
    2730 * This tests various core message creation functions.  
     
    5154    /* Buffer must be invalid. */ 
    5255    if (pjsip_tx_data_is_valid(invite) != 0) { 
    53         PJ_LOG(3,("", "   error: buffer must be invalid")); 
     56        PJ_LOG(3,(THIS_FILE, "   error: buffer must be invalid")); 
    5457        return -14; 
    5558    } 
    5659    /* Reference counter must be set to 1. */ 
    5760    if (pj_atomic_get(invite->ref_cnt) != 1) { 
    58         PJ_LOG(3,("", "   error: invalid reference counter")); 
     61        PJ_LOG(3,(THIS_FILE, "   error: invalid reference counter")); 
    5962        return -15; 
    6063    } 
     
    103106    /* Buffer must be invalid. */ 
    104107    if (pjsip_tx_data_is_valid(invite2) != 0) { 
    105         PJ_LOG(3,("", "   error: buffer must be invalid")); 
     108        PJ_LOG(3,(THIS_FILE, "   error: buffer must be invalid")); 
    106109        return -34; 
    107110    } 
    108111    /* Reference counter must be set to 1. */ 
    109112    if (pj_atomic_get(invite2->ref_cnt) != 1) { 
    110         PJ_LOG(3,("", "   error: invalid reference counter")); 
     113        PJ_LOG(3,(THIS_FILE, "   error: invalid reference counter")); 
    111114        return -35; 
    112115    } 
     
    142145    /* Done checking invite2. We can delete this. */ 
    143146    if (pjsip_tx_data_dec_ref(invite2) != PJSIP_EBUFDESTROYED) { 
    144         PJ_LOG(3,("", "   error: request buffer not destroyed!")); 
     147        PJ_LOG(3,(THIS_FILE, "   error: request buffer not destroyed!")); 
    145148        return -49; 
    146149    } 
     
    173176    /* Buffer must be invalid. */ 
    174177    if (pjsip_tx_data_is_valid(response) != 0) { 
    175         PJ_LOG(3,("", "   error: buffer must be invalid")); 
     178        PJ_LOG(3,(THIS_FILE, "   error: buffer must be invalid")); 
    176179        return -54; 
    177180    } 
    178181    /* Check reference counter. */ 
    179182    if (pj_atomic_get(response->ref_cnt) != 1) { 
    180         PJ_LOG(3,("", "   error: invalid ref count in response")); 
     183        PJ_LOG(3,(THIS_FILE, "   error: invalid ref count in response")); 
    181184        return -55; 
    182185    } 
     
    215218    /* Buffer must be invalid. */ 
    216219    if (pjsip_tx_data_is_valid(cancel) != 0) { 
    217         PJ_LOG(3,("", "   error: buffer must be invalid")); 
     220        PJ_LOG(3,(THIS_FILE, "   error: buffer must be invalid")); 
    218221        return -84; 
    219222    } 
    220223    /* Check reference counter. */ 
    221224    if (pj_atomic_get(cancel->ref_cnt) != 1) { 
    222         PJ_LOG(3,("", "   error: invalid ref count in CANCEL request")); 
     225        PJ_LOG(3,(THIS_FILE, "   error: invalid ref count in CANCEL request")); 
    223226        return -85; 
    224227    } 
     
    248251    /* Done checking CANCEL request. */ 
    249252    if (pjsip_tx_data_dec_ref(cancel) != PJSIP_EBUFDESTROYED) { 
    250         PJ_LOG(3,("", "   error: response buffer not destroyed!")); 
     253        PJ_LOG(3,(THIS_FILE, "   error: response buffer not destroyed!")); 
    251254        return -99; 
    252255    } 
     
    260263    status = pjsip_endpt_create_ack( endpt, invite, &dummy_rdata, &ack ); 
    261264    if (status != PJ_SUCCESS) { 
    262         PJ_LOG(3,("", "   error: unable to create ACK")); 
     265        PJ_LOG(3,(THIS_FILE, "   error: unable to create ACK")); 
    263266        return -100; 
    264267    } 
    265268    /* Buffer must be invalid. */ 
    266269    if (pjsip_tx_data_is_valid(ack) != 0) { 
    267         PJ_LOG(3,("", "   error: buffer must be invalid")); 
     270        PJ_LOG(3,(THIS_FILE, "   error: buffer must be invalid")); 
    268271        return -104; 
    269272    } 
    270273    /* Check reference counter. */ 
    271274    if (pj_atomic_get(ack->ref_cnt) != 1) { 
    272         PJ_LOG(3,("", "   error: invalid ref count in ACK request")); 
     275        PJ_LOG(3,(THIS_FILE, "   error: invalid ref count in ACK request")); 
    273276        return -105; 
    274277    } 
     
    299302    /* Done checking invite message. */ 
    300303    if (pjsip_tx_data_dec_ref(invite) != PJSIP_EBUFDESTROYED) { 
    301         PJ_LOG(3,("", "   error: response buffer not destroyed!")); 
     304        PJ_LOG(3,(THIS_FILE, "   error: response buffer not destroyed!")); 
    302305        return -120; 
    303306    } 
     
    305308    /* Done checking response message. */ 
    306309    if (pjsip_tx_data_dec_ref(response) != PJSIP_EBUFDESTROYED) { 
    307         PJ_LOG(3,("", "   error: response buffer not destroyed!")); 
     310        PJ_LOG(3,(THIS_FILE, "   error: response buffer not destroyed!")); 
    308311        return -130; 
    309312    } 
     
    311314    /* Done checking ack message. */ 
    312315    if (pjsip_tx_data_dec_ref(ack) != PJSIP_EBUFDESTROYED) { 
    313         PJ_LOG(3,("", "   error: response buffer not destroyed!")); 
     316        PJ_LOG(3,(THIS_FILE, "   error: response buffer not destroyed!")); 
    314317        return -140; 
    315318    } 
Note: See TracChangeset for help on using the changeset viewer.