- Timestamp:
- Jan 1, 2009 8:56:36 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib-util/src/pjlib-util-test/resolver_test.c
r2403 r2407 703 703 PJ_UNUSED_ARG(user_data); 704 704 705 pj_assert(status == PJ_SUCCESS);706 pj_assert(resp);707 pj_assert(resp->hdr.anscount == 1);708 pj_assert(resp->ans[0].type == PJ_DNS_TYPE_A);709 pj_assert(resp->ans[0].rdata.a.ip_addr.s_addr == IP_ADDR0);710 711 705 pj_sem_post(sem); 706 707 PJ_ASSERT_ON_FAIL(status == PJ_SUCCESS, return); 708 PJ_ASSERT_ON_FAIL(resp, return); 709 PJ_ASSERT_ON_FAIL(resp->hdr.anscount == 1, return); 710 PJ_ASSERT_ON_FAIL(resp->ans[0].type == PJ_DNS_TYPE_A, return); 711 PJ_ASSERT_ON_FAIL(resp->ans[0].rdata.a.ip_addr.s_addr == IP_ADDR0, return); 712 712 713 } 713 714 … … 779 780 PJ_UNUSED_ARG(resp); 780 781 781 pj_assert(status == PJ_STATUS_FROM_DNS_RCODE(PJ_DNS_RCODE_NXDOMAIN));782 783 782 pj_sem_post(sem); 783 784 PJ_ASSERT_ON_FAIL(status==PJ_STATUS_FROM_DNS_RCODE(PJ_DNS_RCODE_NXDOMAIN), 785 return); 784 786 } 785 787 … … 1015 1017 PJ_UNUSED_ARG(user_data); 1016 1018 1017 pj_assert(status == PJ_SUCCESS);1018 pj_assert(rec->count == 1);1019 pj_assert(rec->entry[0].priority == 1);1020 pj_assert(rec->entry[0].weight == 2);1021 pj_assert(pj_strcmp2(&rec->entry[0].server.name, "sip.somedomain.com")==0);1022 pj_assert(pj_strcmp2(&rec->entry[0].server.alias, "sipalias.somedomain.com")==0);1023 pj_assert(rec->entry[0].server.addr[0].s_addr == IP_ADDR1);1024 pj_assert(rec->entry[0].port == PORT1);1025 1026 1019 pj_sem_post(sem); 1020 1021 PJ_ASSERT_ON_FAIL(status == PJ_SUCCESS, return); 1022 PJ_ASSERT_ON_FAIL(rec->count == 1, return); 1023 PJ_ASSERT_ON_FAIL(rec->entry[0].priority == 1, return); 1024 PJ_ASSERT_ON_FAIL(rec->entry[0].weight == 2, return); 1025 PJ_ASSERT_ON_FAIL(pj_strcmp2(&rec->entry[0].server.name, "sip.somedomain.com")==0, 1026 return); 1027 PJ_ASSERT_ON_FAIL(pj_strcmp2(&rec->entry[0].server.alias, "sipalias.somedomain.com")==0, 1028 return); 1029 PJ_ASSERT_ON_FAIL(rec->entry[0].server.addr[0].s_addr == IP_ADDR1, return); 1030 PJ_ASSERT_ON_FAIL(rec->entry[0].port == PORT1, return); 1031 1032 1027 1033 } 1028 1034 … … 1033 1039 PJ_UNUSED_ARG(user_data); 1034 1040 1035 pj_assert(status == PJ_STATUS_FROM_DNS_RCODE(PJ_DNS_RCODE_NXDOMAIN));1036 pj_assert(rec->count == 0);1037 1038 1041 pj_sem_post(sem); 1042 1043 PJ_ASSERT_ON_FAIL(status==PJ_STATUS_FROM_DNS_RCODE(PJ_DNS_RCODE_NXDOMAIN), 1044 return); 1045 PJ_ASSERT_ON_FAIL(rec->count == 0, return); 1039 1046 } 1040 1047 … … 1176 1183 PJ_UNUSED_ARG(user_data); 1177 1184 1178 pj_assert(status == PJ_SUCCESS);1179 pj_assert(rec->count == 1);1180 pj_assert(rec->entry[0].priority == 0);1181 pj_assert(rec->entry[0].weight == 0);1182 pj_assert(pj_strcmp2(&rec->entry[0].server.name, TARGET)==0);1183 pj_assert(pj_strcmp2(&rec->entry[0].server.alias, "sipalias01." TARGET)==0);1184 pj_assert(rec->entry[0].server.addr[0].s_addr == IP_ADDR2);1185 pj_assert(rec->entry[0].port == PORT2);1186 1187 1185 pj_sem_post(sem); 1186 1187 PJ_ASSERT_ON_FAIL(status == PJ_SUCCESS, return); 1188 PJ_ASSERT_ON_FAIL(rec->count == 1, return); 1189 PJ_ASSERT_ON_FAIL(rec->entry[0].priority == 0, return); 1190 PJ_ASSERT_ON_FAIL(rec->entry[0].weight == 0, return); 1191 PJ_ASSERT_ON_FAIL(pj_strcmp2(&rec->entry[0].server.name, TARGET)==0, 1192 return); 1193 PJ_ASSERT_ON_FAIL(pj_strcmp2(&rec->entry[0].server.alias, "sipalias01." TARGET)==0, 1194 return); 1195 PJ_ASSERT_ON_FAIL(rec->entry[0].server.addr[0].s_addr == IP_ADDR2, return); 1196 PJ_ASSERT_ON_FAIL(rec->entry[0].port == PORT2, return); 1188 1197 } 1189 1198 … … 1307 1316 1308 1317 PJ_UNUSED_ARG(user_data); 1318 PJ_UNUSED_ARG(status); 1319 PJ_UNUSED_ARG(rec); 1309 1320 1310 1321 pj_assert(status == PJ_SUCCESS); 1311 1322 pj_assert(rec->count == PJ_DNS_SRV_MAX_ADDR); 1323 1312 1324 for (i=0; i<PJ_DNS_SRV_MAX_ADDR; ++i) { 1313 1325 unsigned j;
Note: See TracChangeset
for help on using the changeset viewer.