Changeset 1789 for pjproject/trunk/pjlib/src/pjlib-test/ioq_tcp.c
- Timestamp:
- Feb 13, 2008 3:17:28 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pjlib-test/ioq_tcp.c
r1405 r1789 233 233 * Compliance test for success scenario. 234 234 */ 235 static int compliance_test_0( void)235 static int compliance_test_0(pj_bool_t allow_concur) 236 236 { 237 237 pj_sock_t ssock=-1, csock0=-1, csock1=-1; … … 291 291 app_perror("...ERROR in pj_ioqueue_create()", rc); 292 292 status=-20; goto on_error; 293 } 294 295 // Concurrency 296 rc = pj_ioqueue_set_default_concurrency(ioque, allow_concur); 297 if (rc != PJ_SUCCESS) { 298 app_perror("...ERROR in pj_ioqueue_set_default_concurrency()", rc); 299 status=-21; goto on_error; 293 300 } 294 301 … … 459 466 * In this case, the client connects to a non-existant service. 460 467 */ 461 static int compliance_test_1( void)468 static int compliance_test_1(pj_bool_t allow_concur) 462 469 { 463 470 pj_sock_t csock1=PJ_INVALID_SOCKET; … … 478 485 if (!ioque) { 479 486 status=-20; goto on_error; 487 } 488 489 // Concurrency 490 rc = pj_ioqueue_set_default_concurrency(ioque, allow_concur); 491 if (rc != PJ_SUCCESS) { 492 status=-21; goto on_error; 480 493 } 481 494 … … 582 595 * Repeated connect/accept on the same listener socket. 583 596 */ 584 static int compliance_test_2( void)597 static int compliance_test_2(pj_bool_t allow_concur) 585 598 { 586 599 #if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0 … … 648 661 } 649 662 663 664 // Concurrency 665 rc = pj_ioqueue_set_default_concurrency(ioque, allow_concur); 666 if (rc != PJ_SUCCESS) { 667 app_perror("...ERROR in pj_ioqueue_set_default_concurrency()", rc); 668 return -11; 669 } 650 670 651 671 // Allocate buffers for send and receive. … … 888 908 889 909 890 int tcp_ioqueue_test()910 static int tcp_ioqueue_test_impl(pj_bool_t allow_concur) 891 911 { 892 912 int status; 913 914 PJ_LOG(3,(THIS_FILE, "..testing with concurency=%d", allow_concur)); 893 915 894 916 PJ_LOG(3, (THIS_FILE, "..%s compliance test 0 (success scenario)", 895 917 pj_ioqueue_name())); 896 if ((status=compliance_test_0( )) != 0) {918 if ((status=compliance_test_0(allow_concur)) != 0) { 897 919 PJ_LOG(1, (THIS_FILE, "....FAILED (status=%d)\n", status)); 898 920 return status; … … 900 922 PJ_LOG(3, (THIS_FILE, "..%s compliance test 1 (failed scenario)", 901 923 pj_ioqueue_name())); 902 if ((status=compliance_test_1( )) != 0) {924 if ((status=compliance_test_1(allow_concur)) != 0) { 903 925 PJ_LOG(1, (THIS_FILE, "....FAILED (status=%d)\n", status)); 904 926 return status; … … 907 929 PJ_LOG(3, (THIS_FILE, "..%s compliance test 2 (repeated accept)", 908 930 pj_ioqueue_name())); 909 if ((status=compliance_test_2( )) != 0) {931 if ((status=compliance_test_2(allow_concur)) != 0) { 910 932 PJ_LOG(1, (THIS_FILE, "....FAILED (status=%d)\n", status)); 911 933 return status; 912 934 } 935 936 return 0; 937 } 938 939 int tcp_ioqueue_test() 940 { 941 int rc; 942 943 rc = tcp_ioqueue_test_impl(PJ_TRUE); 944 if (rc != 0) 945 return rc; 946 947 rc = tcp_ioqueue_test_impl(PJ_FALSE); 948 if (rc != 0) 949 return rc; 913 950 914 951 return 0;
Note: See TracChangeset
for help on using the changeset viewer.