Revision 07dd477d Test/janus_instance_test.c

View differences:

Test/janus_instance_test.c
108 108
	fprintf(stderr,"%s successfully passed!\n",__func__);
109 109
}
110 110

  
111
void janus_instance_ipaddr_test()
112
{
113
	struct janus_instance * janus = NULL;
114
	struct task_manager * tm;
115
	struct mg_mgr * srv;
116
	const char *res;
117

  
118
	res = janus_instance_ipaddr(janus);	
119
	assert(strlen(res) == 0);
120

  
121
	tm = task_manager_new();
122
	srv = (struct mg_mgr*) malloc(sizeof(struct mg_mgr));
123
	mg_mgr_init(srv, NULL);
124
	janus = janus_instance_create(srv, tm, janus_conf);
125
	res = janus_instance_ipaddr(janus);	
126
	assert(strlen(res));
127
	assert(strcmp(res, "127.0.0.1") == 0);
128

  
129
	janus_instance_destroy(&janus);
130
	task_manager_destroy(&tm);
131
	mg_mgr_free(srv);
132
	free(srv);
133
	fprintf(stderr,"%s successfully passed!\n",__func__);
134
}
135

  
111 136
int main(int argv, char ** argc)
112 137
{
113 138
	char wdir[200];
114 139
	strncpy(wdir, dirname(argc[0]), 200);
115
	sprintf(janus_conf, "janus_executable=%s/../Tools/janus/bin/janus,janus_param=--configs-folder=%s/../Tools/janus_conf", wdir, wdir);
140
	sprintf(janus_conf, "janus_executable=%s/../Tools/janus/bin/janus", wdir);
116 141

  
117 142
	janus_instance_create_test();
118 143
	janus_instance_launch_test();
119 144
	janus_instance_create_streaming_point_test();
145
	janus_instance_ipaddr_test();
120 146
	return 0;
121 147
}

Also available in: Unified diff