Changeset 3129


Ignore:
Timestamp:
Mar 30, 2010 11:42:51 AM (15 years ago)
Author:
ming
Message:

Implemented ticket #1052: ipjsystest: pjsystest for iPhone OS

  • ipjsystest:
    • xcode project directory for ipjsystest application
  • pjsystest:
    • Modify pjsystest to support appending path during runtime
Location:
pjproject/branches/projects/iphone/pjsip-apps/src
Files:
16 added
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/iphone/pjsip-apps/src/pjsystest/systest.c

    r2991 r3129  
    2424unsigned    test_item_count; 
    2525test_item_t test_items[SYSTEST_MAX_TEST]; 
     26char        doc_path[PATH_LENGTH] = {0}; 
     27char        res_path[PATH_LENGTH] = {0}; 
     28char        fpath[PATH_LENGTH]; 
    2629 
    2730#define USER_ERROR  "User used said not okay" 
     
    8386/*****************************************************************/ 
    8487 
     88PJ_INLINE(char *) add_path(const char *path, const char *fname) 
     89{ 
     90    strncpy(fpath, path, PATH_LENGTH); 
     91    strncat(fpath, fname, PATH_LENGTH); 
     92    return fpath; 
     93} 
     94 
    8595static void exit_app(void) 
    8696{ 
    87     systest_save_result(RESULT_OUT_PATH); 
     97    systest_save_result(add_path(doc_path, RESULT_OUT_PATH)); 
    8898    gui_destroy(); 
    8999} 
     
    330340static void systest_play_wav1(void) 
    331341{ 
    332     const char *paths[] = { WAV_PLAYBACK_PATH,  
     342    const char *paths[] = { add_path(res_path, WAV_PLAYBACK_PATH), 
    333343                            ALT_PATH1 WAV_PLAYBACK_PATH }; 
    334344    systest_play_wav(PJ_ARRAY_SIZE(paths), paths); 
     
    337347static void systest_play_wav2(void) 
    338348{ 
    339     const char *paths[] = { WAV_TOCK8_PATH,  
     349    const char *paths[] = { add_path(res_path, WAV_TOCK8_PATH), 
    340350                            ALT_PATH1 WAV_TOCK8_PATH}; 
    341351    systest_play_wav(PJ_ARRAY_SIZE(paths), paths); 
     
    348358static void systest_rec_audio(void) 
    349359{ 
    350     const pj_str_t filename = pj_str(WAV_REC_OUT_PATH); 
     360    const pj_str_t filename = pj_str(add_path(doc_path, WAV_REC_OUT_PATH)); 
    351361    pj_pool_t *pool = NULL; 
    352362    enum gui_key key; 
     
    733743static void systest_latency_test(void) 
    734744{ 
    735     const char *ref_wav_paths[] = { WAV_TOCK8_PATH, ALT_PATH1 WAV_TOCK8_PATH }; 
    736     const pj_str_t rec_wav_file = pj_str(WAV_LATENCY_OUT_PATH); 
     745    const char *ref_wav_paths[] = { add_path(res_path, WAV_TOCK8_PATH), ALT_PATH1 WAV_TOCK8_PATH }; 
     746    pj_str_t rec_wav_file; 
    737747    pjsua_player_id play_id = PJSUA_INVALID_ID; 
    738748    pjsua_conf_port_id play_slot = PJSUA_INVALID_ID; 
     
    782792    play_slot = pjsua_player_get_conf_port(play_id); 
    783793 
     794    rec_wav_file = pj_str(add_path(doc_path, WAV_LATENCY_OUT_PATH)); 
    784795    status = pjsua_recorder_create(&rec_wav_file, 0, NULL, -1, 0, &rec_id); 
    785796    if (status != PJ_SUCCESS) 
     
    10581069 
    10591070    pjsua_logging_config_default(&log_cfg); 
    1060     log_cfg.log_filename = pj_str(LOG_OUT_PATH); 
     1071    log_cfg.log_filename = pj_str(add_path(doc_path, LOG_OUT_PATH)); 
    10611072 
    10621073    pjsua_config_default(&systest.ua_cfg); 
  • pjproject/branches/projects/iphone/pjsip-apps/src/pjsystest/systest.h

    r2991 r3129  
    8787extern unsigned     test_item_count; 
    8888extern test_item_t  test_items[SYSTEST_MAX_TEST]; 
     89#define PATH_LENGTH         128 
     90extern char         doc_path[PATH_LENGTH]; 
     91extern char         res_path[PATH_LENGTH]; 
    8992 
    9093test_item_t *systest_alloc_test_item(const char *title); 
Note: See TracChangeset for help on using the changeset viewer.