Ignore:
Timestamp:
Apr 15, 2007 9:58:48 AM (17 years ago)
Author:
bennylp
Message:

Ticket #223: Added pj_strtoul2()

File:
1 edited

Legend:

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

    r974 r1194  
    4949 *  - pj_utoa() 
    5050 *  - pj_strtoul() 
     51 *  - pj_strtoul2() 
    5152 *  - pj_create_random_string() 
    5253 *  - ... and mode.. 
     
    359360        return -280; 
    360361 
     362    /* 
     363     * pj_strtoul2() 
     364     */ 
     365    s5 = pj_str("123456"); 
     366 
     367    pj_strtoul2(&s5, NULL, 10); /* Crash test */ 
     368 
     369    if (pj_strtoul2(&s5, &s4, 10) != 123456UL) 
     370        return -290; 
     371    if (s4.slen != 0) 
     372        return -291; 
     373    if (pj_strtoul2(&s5, &s4, 16) != 0x123456UL) 
     374        return -292; 
     375 
     376    s5 = pj_str("0123ABCD"); 
     377    if (pj_strtoul2(&s5, &s4, 10) != 123) 
     378        return -293; 
     379    if (s4.slen != 4) 
     380        return -294; 
     381    if (s4.ptr == NULL || *s4.ptr != 'A') 
     382        return -295; 
     383    if (pj_strtoul2(&s5, &s4, 16) != 0x123ABCDUL) 
     384        return -296; 
     385    if (s4.slen != 0) 
     386        return -297; 
     387 
    361388    /*  
    362389     * pj_create_random_string()  
Note: See TracChangeset for help on using the changeset viewer.