Changeset 555


Ignore:
Timestamp:
Jun 26, 2006 3:12:55 PM (16 years ago)
Author:
bennylp
Message:

Bring the dead pjsip-test up to date with latest pjsip

Location:
pjproject/trunk/pjsip/src/test-pjsip
Files:
4 edited

Legend:

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

    r547 r555  
    126126    } 
    127127 
     128#if INCLUDE_URI_TEST 
    128129    DO_TEST(uri_test()); 
     130#endif 
     131 
     132#if INCLUDE_MSG_TEST 
    129133    DO_TEST(msg_test()); 
    130134    DO_TEST(msg_err_test()); 
     135#endif 
     136 
     137#if INCLUDE_TXDATA_TEST 
    131138    DO_TEST(txdata_test()); 
     139#endif 
     140 
     141#if INCLUDE_UDP_TEST 
    132142    DO_TEST(transport_udp_test()); 
     143#endif 
     144 
     145#if INCLUDE_LOOP_TEST 
    133146    DO_TEST(transport_loop_test()); 
     147#endif 
     148 
     149#if INCLUDE_TSX_TEST 
    134150    DO_TEST(tsx_basic_test()); 
    135151    DO_TEST(tsx_uac_test()); 
    136152    DO_TEST(tsx_uas_test()); 
     153#endif 
     154 
    137155 
    138156on_return: 
  • pjproject/trunk/pjsip/src/test-pjsip/test.h

    r547 r555  
    2626#define TEST_UDP_PORT       15060 
    2727#define TEST_UDP_PORT_STR   "15060" 
     28 
     29 
     30#define INCLUDE_MESSAGING_GROUP     1 
     31#define INCLUDE_TRANSPORT_GROUP     1 
     32#define INCLUDE_TSX_GROUP           1 
     33 
     34 
     35 
     36#define INCLUDE_URI_TEST        INCLUDE_MESSAGING_GROUP 
     37#define INCLUDE_MSG_TEST        INCLUDE_MESSAGING_GROUP 
     38#define INCLUDE_TXDATA_TEST     INCLUDE_MESSAGING_GROUP 
     39#define INCLUDE_UDP_TEST        INCLUDE_TRANSPORT_GROUP 
     40#define INCLUDE_LOOP_TEST       INCLUDE_TRANSPORT_GROUP 
     41#define INCLUDE_TSX_TEST        INCLUDE_TSX_GROUP 
     42 
     43 
    2844 
    2945/* The tests */ 
  • pjproject/trunk/pjsip/src/test-pjsip/tsx_uac_test.c

    r547 r555  
    947947    // Ignore send result. Some tests do deliberately triggers error 
    948948    // when sending message. 
    949     //if (status != PJ_SUCCESS) { 
    950     //  app_perror("   Error: unable to send request", status); 
    951     //  pjsip_tx_data_dec_ref(tdata); 
    952     //  return -120; 
    953     //} 
     949    if (status != PJ_SUCCESS) { 
     950        // app_perror("   Error: unable to send request", status); 
     951        pjsip_tx_data_dec_ref(tdata); 
     952        // return -120; 
     953    } 
    954954 
    955955 
  • pjproject/trunk/pjsip/src/test-pjsip/tsx_uas_test.c

    r547 r555  
    445445         * TEST4_BRANCH_ID tests receiving retransmissions in TRYING state. 
    446446         */ 
    447         if (tsx->state == PJSIP_TSX_STATE_TERMINATED) { 
     447        if (tsx->state == PJSIP_TSX_STATE_TRYING) { 
     448            /* Request is received. */ 
     449        } else if (tsx->state == PJSIP_TSX_STATE_TERMINATED) { 
    448450 
    449451            /* Check that status code is status_code. */ 
    450452            if (tsx->status_code != TEST4_STATUS_CODE) { 
    451                 PJ_LOG(3,(THIS_FILE, "    error: incorrect status code")); 
     453                PJ_LOG(3,(THIS_FILE,  
     454                          "    error: incorrect status code %d " 
     455                          "(expecting %d)", tsx->status_code, 
     456                          TEST4_STATUS_CODE)); 
    452457                test_complete = -120; 
    453458            } 
     
    461466        } else if (tsx->state != PJSIP_TSX_STATE_DESTROYED)  
    462467        { 
    463             PJ_LOG(3,(THIS_FILE, "    error: unexpected state")); 
     468            PJ_LOG(3,(THIS_FILE, "    error: unexpected state %s (122)", 
     469                      pjsip_tsx_state_str(tsx->state))); 
    464470            test_complete = -122; 
    465471 
     
    472478         * TEST5_BRANCH_ID tests receiving retransmissions in PROCEEDING state 
    473479         */ 
    474         if (tsx->state == PJSIP_TSX_STATE_TERMINATED) { 
     480        if (tsx->state == PJSIP_TSX_STATE_TRYING) { 
     481            /* Request is received. */ 
     482 
     483        } else if (tsx->state == PJSIP_TSX_STATE_TERMINATED) { 
    475484 
    476485            /* Check that status code is status_code. */ 
     
    495504 
    496505        } else if (tsx->state != PJSIP_TSX_STATE_DESTROYED) { 
    497             PJ_LOG(3,(THIS_FILE, "    error: unexpected state")); 
     506            PJ_LOG(3,(THIS_FILE, "    error: unexpected state %s (133)", 
     507                      pjsip_tsx_state_str(tsx->state))); 
    498508            test_complete = -133; 
    499509 
     
    505515         * TEST6_BRANCH_ID tests receiving retransmissions in COMPLETED state 
    506516         */ 
    507         if (tsx->state == PJSIP_TSX_STATE_TERMINATED) { 
     517        if (tsx->state == PJSIP_TSX_STATE_TRYING) { 
     518            /* Request is received. */ 
     519 
     520        } else if (tsx->state == PJSIP_TSX_STATE_TERMINATED) { 
    508521 
    509522            /* Check that status code is status_code. */ 
     
    523536                   tsx->state != PJSIP_TSX_STATE_DESTROYED)  
    524537        { 
    525             PJ_LOG(3,(THIS_FILE, "    error: unexpected state")); 
     538            PJ_LOG(3,(THIS_FILE, "    error: unexpected state %s (142)", 
     539                      pjsip_tsx_state_str(tsx->state))); 
    526540            test_complete = -142; 
    527541 
     
    544558            code = TEST8_STATUS_CODE; 
    545559 
    546         if (tsx->state == PJSIP_TSX_STATE_TERMINATED) { 
     560        if (tsx->state == PJSIP_TSX_STATE_TRYING) { 
     561            /* Request is received. */ 
     562 
     563        } else if (tsx->state == PJSIP_TSX_STATE_TERMINATED) { 
    547564 
    548565            if (test_complete == 0) 
     
    577594        } else if (tsx->state != PJSIP_TSX_STATE_DESTROYED)  { 
    578595 
    579             PJ_LOG(3,(THIS_FILE, "    error: unexpected state")); 
     596            PJ_LOG(3,(THIS_FILE, "    error: unexpected state (154)")); 
    580597            test_complete = -154; 
    581598 
     
    590607         */ 
    591608 
    592         if (tsx->state == PJSIP_TSX_STATE_TERMINATED) { 
     609        if (tsx->state == PJSIP_TSX_STATE_TRYING) { 
     610            /* Request is received. */ 
     611 
     612        } else if (tsx->state == PJSIP_TSX_STATE_TERMINATED) { 
    593613 
    594614            if (test_complete == 0) 
     
    638658        } else if (tsx->state != PJSIP_TSX_STATE_DESTROYED)  { 
    639659 
    640             PJ_LOG(3,(THIS_FILE, "    error: unexpected state")); 
     660            PJ_LOG(3,(THIS_FILE, "    error: unexpected state (166)")); 
    641661            test_complete = -166; 
    642662 
     
    746766            if (status != PJ_SUCCESS) { 
    747767                app_perror("    error: unable to create transaction", status); 
    748                 test_complete = -120; 
     768                test_complete = -116; 
    749769                return PJ_TRUE; 
    750770            } 
     
    12721292    int status; 
    12731293 
    1274     PJ_LOG(3,(THIS_FILE,"  test1: basic sending 2xx final response")); 
     1294    PJ_LOG(3,(THIS_FILE,"  test3: basic sending 2xx final response")); 
    12751295 
    12761296    status = perform_test("sip:129.0.0.1;transport=loop-dgram", 
Note: See TracChangeset for help on using the changeset viewer.