Ignore:
Timestamp:
Sep 21, 2008 10:01:46 PM (16 years ago)
Author:
bennylp
Message:

Ticket #639: added torture tests for handling non-ASCII UTF-8 characters in SIP message elements

File:
1 edited

Legend:

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

    r2286 r2303  
    807807static int hdr_test_via_ipv6_3(pjsip_hdr *h); 
    808808static int hdr_test_retry_after1(pjsip_hdr *h); 
     809static int hdr_test_subject_utf(pjsip_hdr *h); 
    809810 
    810811 
     
    10231024        "10(Already Pending Register)", 
    10241025        &hdr_test_retry_after1 
     1026    }, 
     1027 
     1028    { 
     1029        /* Non-ASCII UTF-8 characters in Subject */ 
     1030        "Subject", NULL, 
     1031        "\xC0\x81", 
     1032        &hdr_test_subject_utf 
    10251033    } 
    10261034}; 
     
    16951703    if (pj_strcmp2(&hdr->comment, "Already Pending Register")) 
    16961704        return -2930; 
     1705 
     1706    return 0; 
     1707} 
     1708 
     1709/* Subject: \xC0\x81 */ 
     1710static int hdr_test_subject_utf(pjsip_hdr *h) 
     1711{ 
     1712    pjsip_subject_hdr *hdr = (pjsip_subject_hdr*)h; 
     1713 
     1714    if (pj_strcmp2(&h->name, "Subject")) 
     1715        return -2950; 
     1716 
     1717    if (pj_strcmp2(&hdr->hvalue, "\xC0\x81")) 
     1718        return -2960; 
    16971719 
    16981720    return 0; 
Note: See TracChangeset for help on using the changeset viewer.