Fix builddir/srcdir for tests

This commit is contained in:
Willem Toorop 2015-07-19 12:15:28 +02:00
parent e91f7d53b5
commit d52b10e703
2 changed files with 8 additions and 6 deletions

View File

@ -248,8 +248,7 @@ check_getdns_transport.lo check_getdns_transport.o: $(srcdir)/check_getdns_trans
$(srcdir)/check_getdns_transport.h $(srcdir)/check_getdns_common.h ../getdns/getdns.h \
../getdns/getdns_extra.h
getdns_query.lo getdns_query.o: $(srcdir)/getdns_query.c ../config.h ../getdns/getdns.h \
../getdns/getdns_extra.h ../types-internal.h ../getdns/getdns.h \
../getdns/getdns_extra.h ../util/rbtree.h
../getdns/getdns_extra.h
testmessages.lo testmessages.o: $(srcdir)/testmessages.c $(srcdir)/testmessages.h
tests_dict.lo tests_dict.o: $(srcdir)/tests_dict.c $(srcdir)/testmessages.h ../getdns/getdns.h
tests_list.lo tests_list.o: $(srcdir)/tests_list.c $(srcdir)/testmessages.h ../getdns/getdns.h

View File

@ -32,7 +32,6 @@
#include <dirent.h>
#include <getdns/getdns.h>
#include <getdns/getdns_extra.h>
#include <types-internal.h>
static int quiet = 0;
static int batch_mode = 0;
@ -104,7 +103,11 @@ static getdns_return_t
fill_transport_list(getdns_context *context, char *transport_list_str,
getdns_transport_list_t *transports, size_t *transport_count)
{
for (size_t i = 0; i < strlen(transport_list_str); i++, (*transport_count)++) {
size_t max_transports = *transport_count;
*transport_count = 0;
for ( size_t i = 0
; i < max_transports && i < strlen(transport_list_str)
; i++, (*transport_count)++) {
switch(*(transport_list_str + i)) {
case 'U':
transports[i] = GETDNS_TRANSPORT_UDP;
@ -543,8 +546,8 @@ getdns_return_t parse_args(int argc, char **argv)
"after -l\n");
return GETDNS_RETURN_GENERIC_ERROR;
}
size_t transport_count = 0;
getdns_transport_list_t transports[GETDNS_TRANSPORTS_MAX];
getdns_transport_list_t transports[10];
size_t transport_count = sizeof(transports);
if ((r = fill_transport_list(context, argv[i], transports, &transport_count)) ||
(r = getdns_context_set_dns_transport_list(context,
transport_count, transports))){