Benny Prijono | 5dcb38d | 2005-11-21 01:55:47 +0000 | [diff] [blame] | 1 | /* $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 | |
| 24 | extern pjsip_endpoint *endpt; |
| 25 | |
Benny Prijono | fa73e3e | 2006-01-05 23:35:46 +0000 | [diff] [blame] | 26 | #define TEST_UDP_PORT 15060 |
| 27 | #define TEST_UDP_PORT_STR "15060" |
Benny Prijono | 5dcb38d | 2005-11-21 01:55:47 +0000 | [diff] [blame] | 28 | |
Benny Prijono | 0ca04b6 | 2005-12-30 23:50:15 +0000 | [diff] [blame] | 29 | /* The tests */ |
| 30 | int uri_test(void); |
| 31 | int msg_test(void); |
| 32 | int txdata_test(void); |
| 33 | int transport_udp_test(void); |
Benny Prijono | fa73e3e | 2006-01-05 23:35:46 +0000 | [diff] [blame] | 34 | int transport_loop_test(void); |
Benny Prijono | 85598d9 | 2006-01-07 18:44:25 +0000 | [diff] [blame] | 35 | int tsx_basic_test(void); |
Benny Prijono | fa73e3e | 2006-01-05 23:35:46 +0000 | [diff] [blame] | 36 | int tsx_uac_test(void); |
Benny Prijono | dbe337a | 2006-01-08 23:57:52 +0000 | [diff] [blame] | 37 | int tsx_uas_test(void); |
Benny Prijono | 0ca04b6 | 2005-12-30 23:50:15 +0000 | [diff] [blame] | 38 | |
| 39 | /* Transport test helpers (transport_test.c). */ |
| 40 | int generic_transport_test(pjsip_transport *tp); |
| 41 | int transport_send_recv_test( pjsip_transport_type_e tp_type, |
| 42 | pjsip_transport *ref_tp, |
Benny Prijono | fa73e3e | 2006-01-05 23:35:46 +0000 | [diff] [blame] | 43 | char *target_url ); |
Benny Prijono | 0ca04b6 | 2005-12-30 23:50:15 +0000 | [diff] [blame] | 44 | int transport_rt_test( pjsip_transport_type_e tp_type, |
| 45 | pjsip_transport *ref_tp, |
Benny Prijono | 85598d9 | 2006-01-07 18:44:25 +0000 | [diff] [blame] | 46 | char *target_url, |
| 47 | int *pkt_lost); |
Benny Prijono | 0ca04b6 | 2005-12-30 23:50:15 +0000 | [diff] [blame] | 48 | |
| 49 | /* Test main entry */ |
Benny Prijono | 5dcb38d | 2005-11-21 01:55:47 +0000 | [diff] [blame] | 50 | int test_main(void); |
Benny Prijono | 0ca04b6 | 2005-12-30 23:50:15 +0000 | [diff] [blame] | 51 | |
| 52 | /* Test utilities. */ |
Benny Prijono | 5dcb38d | 2005-11-21 01:55:47 +0000 | [diff] [blame] | 53 | void app_perror(const char *msg, pj_status_t status); |
Benny Prijono | 85598d9 | 2006-01-07 18:44:25 +0000 | [diff] [blame] | 54 | int init_msg_logger(void); |
| 55 | int msg_logger_set_enabled(pj_bool_t enabled); |
| 56 | void flush_events(unsigned duration); |
Benny Prijono | 5dcb38d | 2005-11-21 01:55:47 +0000 | [diff] [blame] | 57 | |
Benny Prijono | 9c1d9f5 | 2006-01-07 23:01:56 +0000 | [diff] [blame] | 58 | /* Settings. */ |
| 59 | extern int log_level; |
| 60 | |
Benny Prijono | 5dcb38d | 2005-11-21 01:55:47 +0000 | [diff] [blame] | 61 | #endif /* __TEST_H__ */ |