[sofia-sip] Build internal tests
This commit is contained in:
parent
598d52d5fb
commit
2dced93d94
|
@ -1 +1 @@
|
||||||
Thu Apr 16 17:42:40 UTC 2020
|
Thu Apr 30 14:02:03 UTC 2020
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = foreign 1.7
|
AUTOMAKE_OPTIONS = foreign 1.7
|
||||||
|
|
||||||
SUBDIRS = libsofia-sip-ua $(GLIB_SUBDIRS) packages # tests s2check utils
|
SUBDIRS = libsofia-sip-ua $(GLIB_SUBDIRS) packages tests s2check utils
|
||||||
DIST_SUBDIRS = s2check libsofia-sip-ua libsofia-sip-ua-glib utils packages \
|
DIST_SUBDIRS = s2check libsofia-sip-ua libsofia-sip-ua-glib utils packages \
|
||||||
tests win32 open_c
|
tests win32 open_c
|
||||||
|
|
||||||
|
|
|
@ -1293,7 +1293,7 @@ int test_mime(void)
|
||||||
TEST_1(mp = mp->mp_next);
|
TEST_1(mp = mp->mp_next);
|
||||||
|
|
||||||
TEST_1(mp->mp_data);
|
TEST_1(mp->mp_data);
|
||||||
TEST(memcmp(mp->mp_data, CRLF "--" "LaGqGt4BI6Ho" CR LF, mp->mp_len), 0);
|
TEST(memcmp(mp->mp_data, CRLF "--" "LaGqGt4BI6Ho" CRLF, mp->mp_len), 0);
|
||||||
|
|
||||||
TEST_1(c = mp->mp_content_type);
|
TEST_1(c = mp->mp_content_type);
|
||||||
TEST_S(c->c_type, "text/plain"); TEST_S(c->c_subtype, "plain");
|
TEST_S(c->c_type, "text/plain"); TEST_S(c->c_subtype, "plain");
|
||||||
|
|
|
@ -61,7 +61,7 @@ LDADD = libnta.la \
|
||||||
../msg/libmsg.la \
|
../msg/libmsg.la \
|
||||||
../bnf/libbnf.la \
|
../bnf/libbnf.la \
|
||||||
../su/libsu.la \
|
../su/libsu.la \
|
||||||
${top_builddir}/s2check/libs2.a
|
${top_builddir}/s2check/libs2.a -lz
|
||||||
|
|
||||||
test_nta_LDFLAGS = -static
|
test_nta_LDFLAGS = -static
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ check_nua_SOURCES = check_nua.c check_nua.h \
|
||||||
check_etsi.c check_simple.c
|
check_etsi.c check_simple.c
|
||||||
|
|
||||||
check_nua_LDADD = $(nua_libs) ${top_builddir}/s2check/libs2.a \
|
check_nua_LDADD = $(nua_libs) ${top_builddir}/s2check/libs2.a \
|
||||||
@CHECK_LIBS@
|
@CHECK_LIBS@ -lz
|
||||||
|
|
||||||
nua_libs = libnua.la \
|
nua_libs = libnua.la \
|
||||||
../iptsec/libiptsec.la \
|
../iptsec/libiptsec.la \
|
||||||
|
|
|
@ -14,6 +14,7 @@ AUTOMAKE_OPTIONS = foreign
|
||||||
# Header paths
|
# Header paths
|
||||||
|
|
||||||
AM_CPPFLAGS = $(INTERNAL_INCLUDES)
|
AM_CPPFLAGS = $(INTERNAL_INCLUDES)
|
||||||
|
LD_FLAGS = -lz
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Build targets
|
# Build targets
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
# Header paths
|
# Header paths
|
||||||
|
|
||||||
AM_CPPFLAGS = $(INTERNAL_INCLUDES)
|
AM_CPPFLAGS = $(INTERNAL_INCLUDES)
|
||||||
|
AM_LDFLAGS = -ldl
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Build targets
|
# Build targets
|
||||||
|
|
|
@ -66,7 +66,7 @@ s2_getlocalinfo(su_localinfo_t const *hints,
|
||||||
su_localinfo_t **return_localinfo)
|
su_localinfo_t **return_localinfo)
|
||||||
{
|
{
|
||||||
int error = 0, ip4 = 0, ip6 = 0, i;
|
int error = 0, ip4 = 0, ip6 = 0, i;
|
||||||
su_localinfo_t *result = NULL, **rr = &result;
|
su_localinfo_t *result = NULL, **rr;
|
||||||
su_localinfo_t hh[1] = {{ 0 }};
|
su_localinfo_t hh[1] = {{ 0 }};
|
||||||
|
|
||||||
assert(return_localinfo);
|
assert(return_localinfo);
|
||||||
|
|
|
@ -195,13 +195,14 @@ s2_sip_next_request(sip_method_t method, char const *name)
|
||||||
struct message *m;
|
struct message *m;
|
||||||
|
|
||||||
for (m = s2sip->received; m; m = m->next) {
|
for (m = s2sip->received; m; m = m->next) {
|
||||||
if (m->sip->sip_request)
|
if (m->sip->sip_request) {
|
||||||
if (method == sip_method_unknown && name == NULL)
|
if (method == sip_method_unknown && name == NULL)
|
||||||
return s2_sip_remove_message(m);
|
return s2_sip_remove_message(m);
|
||||||
|
|
||||||
if (m->sip->sip_request->rq_method == method &&
|
if (m->sip->sip_request->rq_method == method &&
|
||||||
strcmp(m->sip->sip_request->rq_method_name, name) == 0)
|
strcmp(m->sip->sip_request->rq_method_name, name) == 0)
|
||||||
return s2_sip_remove_message(m);
|
return s2_sip_remove_message(m);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -57,7 +57,7 @@ void s2_tcase_add_test(TCase *tc, TFun tf, char const *name,
|
||||||
if (strcmp(*patterns, "*")) {
|
if (strcmp(*patterns, "*")) {
|
||||||
printf("%s: selected\n", name);
|
printf("%s: selected\n", name);
|
||||||
}
|
}
|
||||||
_tcase_add_test(tc, tf, name, signo, start, end);
|
_tcase_add_test(tc, tf, name, signo, 0, start, end);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ void s2_tcase_add_test(TCase *tc, TFun tf, char const *name,
|
||||||
if (strcmp(*patterns, "*")) {
|
if (strcmp(*patterns, "*")) {
|
||||||
printf("%s: selected\n", name);
|
printf("%s: selected\n", name);
|
||||||
}
|
}
|
||||||
_tcase_add_test(tc, tf, name, signo, start, end);
|
_tcase_add_test(tc, tf, name, signo, 0, start, end);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ s2_timed_logger(void *stream, char const *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
char buffer[4096];
|
char buffer[4096];
|
||||||
su_time_t now = su_now();
|
su_time_t now = su_now();
|
||||||
size_t prefix, wrote;
|
size_t prefix;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
snprintf(buffer, sizeof buffer,
|
snprintf(buffer, sizeof buffer,
|
||||||
|
@ -70,5 +70,5 @@ s2_timed_logger(void *stream, char const *fmt, va_list ap)
|
||||||
prefix = strlen(buffer);
|
prefix = strlen(buffer);
|
||||||
n = vsnprintf(buffer + prefix, (sizeof buffer) - prefix, fmt, ap);
|
n = vsnprintf(buffer + prefix, (sizeof buffer) - prefix, fmt, ap);
|
||||||
if (n > 0)
|
if (n > 0)
|
||||||
wrote = fwrite(buffer, prefix + n, 1, stream);
|
fwrite(buffer, prefix + n, 1, stream);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ EXTRA_DIST = check_sofia.h check_sofia.c suite_for_nua.c
|
||||||
test_nua_SOURCES = test_nua.c
|
test_nua_SOURCES = test_nua.c
|
||||||
|
|
||||||
test_nua_LDADD = $(check_LIBRARIES) \
|
test_nua_LDADD = $(check_LIBRARIES) \
|
||||||
${sofiabuilddir}/libsofia-sip-ua.la
|
${sofiabuilddir}/libsofia-sip-ua.la -ldl
|
||||||
|
|
||||||
check_LIBRARIES = libtestnua.a libtestproxy.a libtestnat.a
|
check_LIBRARIES = libtestnua.a libtestproxy.a libtestnat.a
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ check_sofia_LDADD = $(check_LIBRARIES) \
|
||||||
@CHECK_LIBS@
|
@CHECK_LIBS@
|
||||||
|
|
||||||
check_dlopen_sofia_CFLAGS = -I$(top_srcdir)/s2check @CHECK_CFLAGS@
|
check_dlopen_sofia_CFLAGS = -I$(top_srcdir)/s2check @CHECK_CFLAGS@
|
||||||
check_dlopen_sofia_LDADD = ${top_builddir}/s2check/libs2.a @CHECK_LIBS@
|
check_dlopen_sofia_LDADD = ${top_builddir}/s2check/libs2.a @CHECK_LIBS@ -ldl
|
||||||
|
|
||||||
CLEANFILES = tmp_sippasswd.??????
|
CLEANFILES = tmp_sippasswd.??????
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,9 @@ int main(int argc, char *argv[])
|
||||||
int exitcode = 0;
|
int exitcode = 0;
|
||||||
int o_sctp = 1, o_tls_sctp = 1, o_verbatim = 1;
|
int o_sctp = 1, o_tls_sctp = 1, o_verbatim = 1;
|
||||||
int family = 0, multiple = 0;
|
int family = 0, multiple = 0;
|
||||||
|
/*
|
||||||
char const *dnsserver = NULL;
|
char const *dnsserver = NULL;
|
||||||
|
*/
|
||||||
char const *string;
|
char const *string;
|
||||||
url_t *uri = NULL;
|
url_t *uri = NULL;
|
||||||
|
|
||||||
|
@ -272,8 +274,10 @@ int main(int argc, char *argv[])
|
||||||
if (!family)
|
if (!family)
|
||||||
dig->ip4 = 1, dig->ip6 = 2;
|
dig->ip4 = 1, dig->ip6 = 2;
|
||||||
|
|
||||||
|
/*
|
||||||
if (argv[1] && argv[1][0] == '@')
|
if (argv[1] && argv[1][0] == '@')
|
||||||
dnsserver = argv++[1] + 1;
|
dnsserver = argv++[1] + 1;
|
||||||
|
*/
|
||||||
|
|
||||||
if (!argv[1])
|
if (!argv[1])
|
||||||
usage(2);
|
usage(2);
|
||||||
|
|
|
@ -398,7 +398,8 @@ char *readfile(FILE *f)
|
||||||
len += fread(buffer + len, 1, 8192, f);
|
len += fread(buffer + len, 1, 8192, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer[len] = '\0';
|
if (buffer)
|
||||||
|
buffer[len] = '\0';
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue