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
diff --git a/pjsip/src/test-pjsip/dns_test.c b/pjsip/src/test-pjsip/dns_test.c
index 62484d4..5c90470 100644
--- a/pjsip/src/test-pjsip/dns_test.c
+++ b/pjsip/src/test-pjsip/dns_test.c
@@ -47,6 +47,7 @@
{
/* 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 @@
*/
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 @@
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 @@
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 7491a0d..62f85fb 100644
--- a/pjsip/src/test-pjsip/msg_test.c
+++ b/pjsip/src/test-pjsip/msg_test.c
@@ -1523,7 +1523,7 @@
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 0e12847..60b7bce 100644
--- a/pjsip/src/test-pjsip/tsx_uac_test.c
+++ b/pjsip/src/test-pjsip/tsx_uac_test.c
@@ -1151,7 +1151,7 @@
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;