Fixed failure in unit test for SIP resolver, also shorten some benchmarks

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1372 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Benny Prijono 2007-06-19 08:46:02 +00:00
parent 371cf0ac04
commit d4791af8dd
3 changed files with 23 additions and 3 deletions

View file

@ -47,6 +47,7 @@ static void add_dns_entries(pj_dns_resolver *resv)
{
/* Inject DNS SRV entry */
pj_dns_parsed_packet pkt;
pj_dns_parsed_query q;
pj_dns_parsed_rr ans[4];
pj_dns_parsed_rr ar[5];
pj_str_t tmp;
@ -154,8 +155,13 @@ static void add_dns_entries(pj_dns_resolver *resv)
*/
for (i=0; i<PJ_ARRAY_SIZE(ar); ++i) {
pj_bzero(&pkt, sizeof(pkt));
pkt.hdr.anscount = 1;
pkt.hdr.flags = PJ_DNS_SET_QR(1);
pkt.hdr.qdcount = 1;
pkt.q = &q;
q.name = ar[i].name;
q.type = ar[i].type;
q.dnsclass = PJ_DNS_CLASS_IN;
pkt.hdr.anscount = 1;
pkt.ans = &ar[i];
pj_dns_resolver_add_entry( resv, &pkt, PJ_FALSE);
@ -259,6 +265,12 @@ static void add_dns_entries(pj_dns_resolver *resv)
ans[0].ttl = 3600;
ans[0].rdata.a.ip_addr = pj_inet_addr(pj_cstr(&tmp, "6.6.6.6"));
pkt.hdr.qdcount = 1;
pkt.q = &q;
q.name = ans[0].name;
q.type = ans[0].type;
q.dnsclass = ans[0].dnsclass;
pj_dns_resolver_add_entry( resv, &pkt, PJ_FALSE);
/* Add the A record for sip07.domain.com */
@ -268,7 +280,15 @@ static void add_dns_entries(pj_dns_resolver *resv)
ans[0].ttl = 3600;
ans[0].rdata.a.ip_addr = pj_inet_addr(pj_cstr(&tmp, "7.7.7.7"));
pkt.hdr.qdcount = 1;
pkt.q = &q;
q.name = ans[0].name;
q.type = ans[0].type;
q.dnsclass = ans[0].dnsclass;
pj_dns_resolver_add_entry( resv, &pkt, PJ_FALSE);
pkt.hdr.qdcount = 0;
}

View file

@ -1523,7 +1523,7 @@ static int hdr_test(void)
int msg_test(void)
{
enum { COUNT = 4, DETECT=0, PARSE=1, PRINT=2 };
enum { COUNT = 1, DETECT=0, PARSE=1, PRINT=2 };
struct {
unsigned detect;
unsigned parse;

View file

@ -1151,7 +1151,7 @@ static int tsx_resolve_error_test(void)
status = perform_tsx_test(-800,
"sip:bob@unresolved-host",
FROM_URI, TEST2_BRANCH_ID, 10,
FROM_URI, TEST2_BRANCH_ID, 20,
&pjsip_options_method);
if (status != 0)
return status;