Changeset 2005 for pjproject/trunk/pjsip/src/test-pjsip/msg_test.c
- Timestamp:
- Jun 11, 2008 11:18:04 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/test-pjsip/msg_test.c
r1957 r2005 790 790 static int hdr_test_contact0(pjsip_hdr *h); 791 791 static int hdr_test_contact1(pjsip_hdr *h); 792 static int hdr_test_contact_q0(pjsip_hdr *h); 793 static int hdr_test_contact_q1(pjsip_hdr *h); 794 static int hdr_test_contact_q2(pjsip_hdr *h); 795 static int hdr_test_contact_q3(pjsip_hdr *h); 796 static int hdr_test_contact_q4(pjsip_hdr *h); 792 797 static int hdr_test_content_length(pjsip_hdr *h); 793 798 static int hdr_test_content_type(pjsip_hdr *h); … … 898 903 899 904 { 905 /* q=0 parameter in Contact header */ 906 "Contact", "m", 907 NAME_ADDR ";q=0", 908 &hdr_test_contact_q0, 909 HDR_FLAG_DONT_PRINT 910 }, 911 912 { 913 /* q=0.5 parameter in Contact header */ 914 "Contact", "m", 915 NAME_ADDR ";q=0.5", 916 &hdr_test_contact_q1 917 }, 918 919 { 920 /* q=1 parameter in Contact header */ 921 "Contact", "m", 922 NAME_ADDR ";q=1", 923 &hdr_test_contact_q2 924 }, 925 926 { 927 /* q=1.0 parameter in Contact header */ 928 "Contact", "m", 929 NAME_ADDR ";q=1.0", 930 &hdr_test_contact_q3, 931 HDR_FLAG_DONT_PRINT 932 }, 933 934 { 935 /* q=1.1 parameter in Contact header */ 936 "Contact", "m", 937 NAME_ADDR ";q=1.15", 938 &hdr_test_contact_q4 939 }, 940 941 { 900 942 /* Content-Length */ 901 943 "Content-Length", "l", … … 1271 1313 if (rc != 0) 1272 1314 return rc; 1315 1316 return 0; 1317 } 1318 1319 /* 1320 NAME_ADDR ";q=0" 1321 */ 1322 static int hdr_test_contact_q0(pjsip_hdr *h) 1323 { 1324 pjsip_contact_hdr *hdr = (pjsip_contact_hdr*)h; 1325 int rc; 1326 1327 if (h->type != PJSIP_H_CONTACT) 1328 return -1710; 1329 1330 rc = nameaddr_test(hdr->uri); 1331 if (rc != 0) 1332 return rc; 1333 1334 if (hdr->q1000 != 0) 1335 return -1711; 1336 1337 return 0; 1338 } 1339 1340 /* 1341 NAME_ADDR ";q=0.5" 1342 */ 1343 static int hdr_test_contact_q1(pjsip_hdr *h) 1344 { 1345 pjsip_contact_hdr *hdr = (pjsip_contact_hdr*)h; 1346 int rc; 1347 1348 if (h->type != PJSIP_H_CONTACT) 1349 return -1710; 1350 1351 rc = nameaddr_test(hdr->uri); 1352 if (rc != 0) 1353 return rc; 1354 1355 if (hdr->q1000 != 500) 1356 return -1712; 1357 1358 return 0; 1359 } 1360 1361 /* 1362 NAME_ADDR ";q=1" 1363 */ 1364 static int hdr_test_contact_q2(pjsip_hdr *h) 1365 { 1366 pjsip_contact_hdr *hdr = (pjsip_contact_hdr*)h; 1367 int rc; 1368 1369 if (h->type != PJSIP_H_CONTACT) 1370 return -1710; 1371 1372 rc = nameaddr_test(hdr->uri); 1373 if (rc != 0) 1374 return rc; 1375 1376 if (hdr->q1000 != 1000) 1377 return -1713; 1378 1379 return 0; 1380 } 1381 1382 /* 1383 NAME_ADDR ";q=1.0" 1384 */ 1385 static int hdr_test_contact_q3(pjsip_hdr *h) 1386 { 1387 pjsip_contact_hdr *hdr = (pjsip_contact_hdr*)h; 1388 int rc; 1389 1390 if (h->type != PJSIP_H_CONTACT) 1391 return -1710; 1392 1393 rc = nameaddr_test(hdr->uri); 1394 if (rc != 0) 1395 return rc; 1396 1397 if (hdr->q1000 != 1000) 1398 return -1714; 1399 1400 return 0; 1401 } 1402 1403 /* 1404 NAME_ADDR ";q=1.15" 1405 */ 1406 static int hdr_test_contact_q4(pjsip_hdr *h) 1407 { 1408 pjsip_contact_hdr *hdr = (pjsip_contact_hdr*)h; 1409 int rc; 1410 1411 if (h->type != PJSIP_H_CONTACT) 1412 return -1710; 1413 1414 rc = nameaddr_test(hdr->uri); 1415 if (rc != 0) 1416 return rc; 1417 1418 if (hdr->q1000 != 1150) 1419 return -1715; 1273 1420 1274 1421 return 0;
Note: See TracChangeset
for help on using the changeset viewer.