Ignore:
Timestamp:
Feb 2, 2006 7:16:07 PM (19 years ago)
Author:
bennylp
Message:

Added SDP negotiator and changed SDP structs (tested)

File:
1 copied

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/test/test.c

    r112 r129  
    1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
    1818 */ 
    19 #include <pj/os.h> 
    20 #include <pj/pool.h> 
    21 #include <pjmedia/sound.h> 
     19#include "test.h" 
    2220 
    23 pj_status_t session_test (pj_pool_factory *pf); 
    24 pj_status_t rtp_test (pj_pool_factory *pf); 
    25 pj_status_t sdp_test(pj_pool_factory *pf); 
    26 int jbuf_main(pj_pool_factory *pf); 
     21#define THIS_FILE   "test.c" 
    2722 
    28 int main() 
     23#define DO_TEST(test)   do { \ 
     24                            PJ_LOG(3, (THIS_FILE, "Running %s...", #test));  \ 
     25                            rc = test; \ 
     26                            PJ_LOG(3, (THIS_FILE,  \ 
     27                                       "%s(%d)",  \ 
     28                                       (rc ? "..ERROR" : "..success"), rc)); \ 
     29                            if (rc!=0) goto on_return; \ 
     30                        } while (0) 
     31 
     32 
     33pj_pool_factory *mem; 
     34 
     35 
     36void app_perror(pj_status_t status, const char *msg) 
    2937{ 
     38    char errbuf[PJMEDIA_ERR_MSG_SIZE]; 
     39     
     40    pjmedia_strerror(status, errbuf, sizeof(errbuf)); 
     41 
     42    PJ_LOG(3,(THIS_FILE, "%s: %s", msg, errbuf)); 
     43} 
     44 
     45int test_main(void) 
     46{ 
     47    int rc; 
    3048    pj_caching_pool caching_pool; 
    3149 
     
    3351    pj_caching_pool_init(&caching_pool, &pj_pool_factory_default_policy, 0); 
    3452 
    35     sdp_test (&caching_pool.factory); 
    36     rtp_test(&caching_pool.factory); 
    37     session_test (&caching_pool.factory); 
     53    pj_log_set_decor(PJ_LOG_HAS_NEWLINE); 
     54 
     55    mem = &caching_pool.factory; 
     56 
     57    DO_TEST(sdp_neg_test()); 
     58    //sdp_test (&caching_pool.factory); 
     59    //rtp_test(&caching_pool.factory); 
     60    //session_test (&caching_pool.factory); 
    3861    //jbuf_main(&caching_pool.factory); 
    3962 
     63    PJ_LOG(3,(THIS_FILE," ")); 
     64 
     65on_return: 
     66 
     67    if (rc != 0) { 
     68        PJ_LOG(3,(THIS_FILE,"Test completed with error(s)!")); 
     69    } else { 
     70        PJ_LOG(3,(THIS_FILE,"Looks like everything is okay!")); 
     71    } 
     72 
    4073    pj_caching_pool_destroy(&caching_pool); 
    41     return 0; 
     74    return rc; 
    4275} 
Note: See TracChangeset for help on using the changeset viewer.