Commit 27772302 authored by Pekka Pessi's avatar Pekka Pessi
Browse files

torture_su_root.c: calling su_init()

Problem reported by Michel Jerris.

darcs-hash:20070226141118-55b16-cb78dd9d6e63b1c6a07f131803b27f28ec889a4f.gz
parent c351e667
......@@ -97,13 +97,25 @@ struct root_test_s {
};
/** Test root initialization */
int init_test(root_test_t *rt)
int init_test(root_test_t *rt,
char const *preference,
su_port_create_f *create,
su_clone_start_f *start)
{
su_sockaddr_t su[1] = {{ 0 }};
int i;
BEGIN();
su_init();
su_port_prefer(create, start);
TEST_1(rt->rt_root = su_root_create(rt));
printf("%s: testing %s (%s) implementation\n",
name, preference, su_root_name(rt->rt_root));
su->su_family = rt->rt_family;
for (i = 0; i < 5; i++) {
......@@ -536,7 +548,7 @@ int main(int argc, char *argv[])
struct {
su_port_create_f *create;
su_clone_start_f *start;
char const *preference;
char const *name;
} prefer[] =
{
{ NULL, NULL, "default" },
......@@ -577,14 +589,7 @@ int main(int argc, char *argv[])
do {
rt = rt1, *rt = *rt0;
su_port_prefer(prefer[i].create, prefer[i].start);
TEST_1(rt->rt_root = su_root_create(rt));
printf("%s: testing %s (%s) implementation\n",
name, prefer[i].preference, su_root_name(rt->rt_root));
retval |= init_test(rt);
retval |= init_test(rt, prefer[i].name, prefer[i].create, prefer[i].start);
retval |= register_test(rt);
retval |= event_test(rt);
su_root_threading(rt->rt_root, 1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment