Ignore:
Timestamp:
Jul 20, 2007 8:08:30 AM (12 years ago)
Author:
bennylp
Message:

Ticket #354: build PJLIB as dynamic libraries (.DSO) in Symbian

File:
1 edited

Legend:

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

    r1266 r1405  
    7878    pj_sockaddr_in addr2; 
    7979    const pj_str_t *hostname; 
    80 #if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0 
    81     /* Symbian IP address is saved in host order */ 
    82     unsigned char A[] = {1, 0, 0, 127}; 
    83 #else 
    84     unsigned char A[] = {127, 0, 0, 1}; 
    85 #endif 
     80    const unsigned char A[] = {127, 0, 0, 1}; 
    8681 
    8782    PJ_LOG(3,("test", "...format_test()")); 
     
    137132    pj_status_t rc = PJ_SUCCESS; 
    138133 
    139     types[0] = PJ_SOCK_STREAM; 
    140     types[1] = PJ_SOCK_DGRAM; 
     134    types[0] = pj_SOCK_STREAM(); 
     135    types[1] = pj_SOCK_DGRAM(); 
    141136 
    142137    PJ_LOG(3,("test", "...simple_sock_test()")); 
     
    144139    for (i=0; i<(int)(sizeof(types)/sizeof(types[0])); ++i) { 
    145140         
    146         rc = pj_sock_socket(PJ_AF_INET, types[i], 0, &sock); 
     141        rc = pj_sock_socket(pj_AF_INET(), types[i], 0, &sock); 
    147142        if (rc != PJ_SUCCESS) { 
    148             app_perror("...error: unable to create socket type %d", rc); 
     143            app_perror("...error: unable to create socket", rc); 
    149144            break; 
    150145        } else { 
     
    238233            } 
    239234            if (received != DATA_LEN-total_received) { 
    240                 if (sock_type != PJ_SOCK_STREAM) { 
     235                if (sock_type != pj_SOCK_STREAM()) { 
    241236                    PJ_LOG(3,("", "...error: expecting %u bytes, got %u bytes", 
    242237                              DATA_LEN-total_received, received)); 
     
    296291        } 
    297292        if (received != BIG_DATA_LEN-total_received) { 
    298             if (sock_type != PJ_SOCK_STREAM) { 
     293            if (sock_type != pj_SOCK_STREAM()) { 
    299294                PJ_LOG(3,("", "...error: expecting %u bytes, got %u bytes", 
    300295                          BIG_DATA_LEN-total_received, received)); 
     
    326321    PJ_LOG(3,("test", "...udp_test()")); 
    327322 
    328     rc = pj_sock_socket(PJ_AF_INET, PJ_SOCK_DGRAM, 0, &ss); 
     323    rc = pj_sock_socket(pj_AF_INET(), pj_SOCK_DGRAM(), 0, &ss); 
    329324    if (rc != 0) { 
    330325        app_perror("...error: unable to create socket", rc); 
     
    332327    } 
    333328 
    334     rc = pj_sock_socket(PJ_AF_INET, PJ_SOCK_DGRAM, 0, &cs); 
     329    rc = pj_sock_socket(pj_AF_INET(), pj_SOCK_DGRAM(), 0, &cs); 
    335330    if (rc != 0) 
    336331        return -110; 
     
    338333    /* Bind server socket. */ 
    339334    pj_bzero(&dstaddr, sizeof(dstaddr)); 
    340     dstaddr.sin_family = PJ_AF_INET; 
     335    dstaddr.sin_family = pj_AF_INET(); 
    341336    dstaddr.sin_port = pj_htons(UDP_PORT); 
    342337    dstaddr.sin_addr = pj_inet_addr(pj_cstr(&s, ADDRESS)); 
     
    349344    /* Bind client socket. */ 
    350345    pj_bzero(&srcaddr, sizeof(srcaddr)); 
    351     srcaddr.sin_family = PJ_AF_INET; 
     346    srcaddr.sin_family = pj_AF_INET(); 
    352347    srcaddr.sin_port = pj_htons(UDP_PORT-1); 
    353348    srcaddr.sin_addr = pj_inet_addr(pj_cstr(&s, ADDRESS)); 
     
    359354             
    360355    /* Test send/recv, with sendto */ 
    361     rc = send_recv_test(PJ_SOCK_DGRAM, ss, cs, &dstaddr, NULL,  
     356    rc = send_recv_test(pj_SOCK_DGRAM(), ss, cs, &dstaddr, NULL,  
    362357                        sizeof(dstaddr)); 
    363358    if (rc != 0) 
     
    365360 
    366361    /* Test send/recv, with sendto and recvfrom */ 
    367     rc = send_recv_test(PJ_SOCK_DGRAM, ss, cs, &dstaddr,  
     362    rc = send_recv_test(pj_SOCK_DGRAM(), ss, cs, &dstaddr,  
    368363                        &srcaddr, sizeof(dstaddr)); 
    369364    if (rc != 0) 
     
    383378 
    384379    /* Test send/recv with send() */ 
    385     rc = send_recv_test(PJ_SOCK_DGRAM, ss, cs, NULL, NULL, 0); 
     380    rc = send_recv_test(pj_SOCK_DGRAM(), ss, cs, NULL, NULL, 0); 
    386381    if (rc != 0) 
    387382        goto on_error; 
    388383 
    389384    /* Test send/recv with send() and recvfrom */ 
    390     rc = send_recv_test(PJ_SOCK_DGRAM, ss, cs, NULL, &srcaddr,  
     385    rc = send_recv_test(pj_SOCK_DGRAM(), ss, cs, NULL, &srcaddr,  
    391386                        sizeof(srcaddr)); 
    392387    if (rc != 0) 
     
    421416    PJ_LOG(3,("test", "...tcp_test()")); 
    422417 
    423     rc = app_socketpair(PJ_AF_INET, PJ_SOCK_STREAM, 0, &ss, &cs); 
     418    rc = app_socketpair(pj_AF_INET(), pj_SOCK_STREAM(), 0, &ss, &cs); 
    424419    if (rc != PJ_SUCCESS) { 
    425420        app_perror("...error: app_socketpair():", rc); 
     
    428423 
    429424    /* Test send/recv with send() and recv() */ 
    430     retval = send_recv_test(PJ_SOCK_STREAM, ss, cs, NULL, NULL, 0); 
     425    retval = send_recv_test(pj_SOCK_STREAM(), ss, cs, NULL, NULL, 0); 
    431426 
    432427    rc = pj_sock_close(cs); 
Note: See TracChangeset for help on using the changeset viewer.