blob: 7f74964d086f94902dbcfa4ec2c2a5068cae0c43 [file] [log] [blame]
Benny Prijono5dcb38d2005-11-21 01:55:47 +00001/* $Id$ */
2/*
3 * Copyright (C) 2003-2006 Benny Prijono <benny@prijono.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#ifndef __TEST_H__
20#define __TEST_H__
21
22#include <pjsip/sip_types.h>
23
24extern pjsip_endpoint *endpt;
25
Benny Prijonofa73e3e2006-01-05 23:35:46 +000026#define TEST_UDP_PORT 15060
27#define TEST_UDP_PORT_STR "15060"
Benny Prijono5dcb38d2005-11-21 01:55:47 +000028
Benny Prijono0ca04b62005-12-30 23:50:15 +000029/* The tests */
30int uri_test(void);
31int msg_test(void);
32int txdata_test(void);
33int transport_udp_test(void);
Benny Prijonofa73e3e2006-01-05 23:35:46 +000034int transport_loop_test(void);
Benny Prijono85598d92006-01-07 18:44:25 +000035int tsx_basic_test(void);
Benny Prijonofa73e3e2006-01-05 23:35:46 +000036int tsx_uac_test(void);
Benny Prijonodbe337a2006-01-08 23:57:52 +000037int tsx_uas_test(void);
Benny Prijono0ca04b62005-12-30 23:50:15 +000038
39/* Transport test helpers (transport_test.c). */
40int generic_transport_test(pjsip_transport *tp);
41int transport_send_recv_test( pjsip_transport_type_e tp_type,
42 pjsip_transport *ref_tp,
Benny Prijonofa73e3e2006-01-05 23:35:46 +000043 char *target_url );
Benny Prijono0ca04b62005-12-30 23:50:15 +000044int transport_rt_test( pjsip_transport_type_e tp_type,
45 pjsip_transport *ref_tp,
Benny Prijono85598d92006-01-07 18:44:25 +000046 char *target_url,
47 int *pkt_lost);
Benny Prijono0ca04b62005-12-30 23:50:15 +000048
49/* Test main entry */
Benny Prijono5dcb38d2005-11-21 01:55:47 +000050int test_main(void);
Benny Prijono0ca04b62005-12-30 23:50:15 +000051
52/* Test utilities. */
Benny Prijono5dcb38d2005-11-21 01:55:47 +000053void app_perror(const char *msg, pj_status_t status);
Benny Prijono85598d92006-01-07 18:44:25 +000054int init_msg_logger(void);
55int msg_logger_set_enabled(pj_bool_t enabled);
56void flush_events(unsigned duration);
Benny Prijono5dcb38d2005-11-21 01:55:47 +000057
Benny Prijono9c1d9f52006-01-07 23:01:56 +000058/* Settings. */
59extern int log_level;
60
Benny Prijono5dcb38d2005-11-21 01:55:47 +000061#endif /* __TEST_H__ */