diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-06-19 08:46:02 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-06-19 08:46:02 +0000 |
commit | a6e4aa1e1559098d31a9962eda4a1e988abc2226 (patch) | |
tree | 0086119cad0d42784785ec62dac6007995e55b0d /pjsip | |
parent | fee01bbc428dd21d97d07dedfc25146f3f813a94 (diff) |
Fixed failure in unit test for SIP resolver, also shorten some benchmarks
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1372 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r-- | pjsip/src/test-pjsip/dns_test.c | 22 | ||||
-rw-r--r-- | pjsip/src/test-pjsip/msg_test.c | 2 | ||||
-rw-r--r-- | pjsip/src/test-pjsip/tsx_uac_test.c | 2 |
3 files changed, 23 insertions, 3 deletions
diff --git a/pjsip/src/test-pjsip/dns_test.c b/pjsip/src/test-pjsip/dns_test.c index 62484d4d..5c90470e 100644 --- a/pjsip/src/test-pjsip/dns_test.c +++ b/pjsip/src/test-pjsip/dns_test.c @@ -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; } diff --git a/pjsip/src/test-pjsip/msg_test.c b/pjsip/src/test-pjsip/msg_test.c index 7491a0d7..62f85fbe 100644 --- a/pjsip/src/test-pjsip/msg_test.c +++ b/pjsip/src/test-pjsip/msg_test.c @@ -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; diff --git a/pjsip/src/test-pjsip/tsx_uac_test.c b/pjsip/src/test-pjsip/tsx_uac_test.c index 0e128474..60b7bcee 100644 --- a/pjsip/src/test-pjsip/tsx_uac_test.c +++ b/pjsip/src/test-pjsip/tsx_uac_test.c @@ -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; |