Fix autotests.

This commit is contained in:
Jan Vidar Krey 2009-08-02 22:29:22 +02:00
parent 0e1cd903da
commit 1f24bd6812
2 changed files with 4 additions and 3 deletions

View File

@ -15,7 +15,7 @@ static void inf_create_hub()
inf_hub = (struct hub_info*) hub_malloc_zero(sizeof(struct hub_info)); inf_hub = (struct hub_info*) hub_malloc_zero(sizeof(struct hub_info));
inf_hub->users = (struct hub_user_manager*) hub_malloc_zero(sizeof(struct hub_user_manager)); inf_hub->users = (struct hub_user_manager*) hub_malloc_zero(sizeof(struct hub_user_manager));
inf_hub->users->list = list_create(); inf_hub->users->list = list_create();
inf_hub->users->free_sid = 1; inf_hub->users->sids = sid_pool_create(500);
inf_hub->acl = (struct acl_handle*) hub_malloc_zero(sizeof(struct acl_handle)); inf_hub->acl = (struct acl_handle*) hub_malloc_zero(sizeof(struct acl_handle));
inf_hub->config = (struct hub_config*) hub_malloc_zero(sizeof(struct hub_config)); inf_hub->config = (struct hub_config*) hub_malloc_zero(sizeof(struct hub_config));
@ -28,6 +28,7 @@ static void inf_destroy_hub()
{ {
/* FIXME */ /* FIXME */
list_destroy(inf_hub->users->list); list_destroy(inf_hub->users->list);
sid_pool_destroy(inf_hub->users->sids);
acl_shutdown(inf_hub->acl); acl_shutdown(inf_hub->acl);
free_config(inf_hub->config); free_config(inf_hub->config);
hub_free(inf_hub->users); hub_free(inf_hub->users);
@ -42,7 +43,7 @@ static void inf_create_user()
if (inf_user) return; if (inf_user) return;
inf_user = (struct hub_user*) hub_malloc_zero(sizeof(struct hub_user)); inf_user = (struct hub_user*) hub_malloc_zero(sizeof(struct hub_user));
inf_user->id.sid = 1; inf_user->id.sid = 1;
inf_user->net.sd = -1; inf_user->net.connection.sd = -1;
inf_user->limits.upload_slots = 1; inf_user->limits.upload_slots = 1;
} }

View File

@ -13,7 +13,7 @@ EXO_TEST(um_test_setup, {
{ {
memset(&um_user[i], 0, sizeof(struct hub_user)); memset(&um_user[i], 0, sizeof(struct hub_user));
um_user[i].id.sid = i+1; um_user[i].id.sid = i+1;
um_user[i].net.sd = -1; um_user[i].net.connection.sd = -1;
} }
return 1; return 1;
}); });