1
/* $Id: test.h 3553 2011-05-05 06:14:19Z nanang $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
#include <pjsip/sip_types.h>
25
extern pjsip_endpoint *endpt;
27
#define TEST_UDP_PORT 15060
28
#define TEST_UDP_PORT_STR "15060"
31
* Memory size to use in caching pool.
34
#ifndef PJSIP_TEST_MEM_SIZE
35
# define PJSIP_TEST_MEM_SIZE (2*1024*1024)
40
#define INCLUDE_MESSAGING_GROUP 1
41
#define INCLUDE_TRANSPORT_GROUP 1
42
#define INCLUDE_TSX_GROUP 1
43
#define INCLUDE_INV_GROUP 1
44
#define INCLUDE_REGC_GROUP 1
46
#define INCLUDE_BENCHMARKS 1
49
* Include tests that normally would fail under certain gcc
50
* optimization levels.
52
#ifndef INCLUDE_GCC_TEST
53
# define INCLUDE_GCC_TEST 0
57
#define INCLUDE_URI_TEST INCLUDE_MESSAGING_GROUP
58
#define INCLUDE_MSG_TEST INCLUDE_MESSAGING_GROUP
59
#define INCLUDE_MULTIPART_TEST INCLUDE_MESSAGING_GROUP
60
#define INCLUDE_TXDATA_TEST INCLUDE_MESSAGING_GROUP
61
#define INCLUDE_TSX_BENCH INCLUDE_MESSAGING_GROUP
62
#define INCLUDE_UDP_TEST INCLUDE_TRANSPORT_GROUP
63
#define INCLUDE_LOOP_TEST INCLUDE_TRANSPORT_GROUP
64
#define INCLUDE_TCP_TEST INCLUDE_TRANSPORT_GROUP
65
#define INCLUDE_RESOLVE_TEST INCLUDE_TRANSPORT_GROUP
66
#define INCLUDE_TSX_TEST INCLUDE_TSX_GROUP
67
#define INCLUDE_INV_OA_TEST INCLUDE_INV_GROUP
68
#define INCLUDE_REGC_TEST INCLUDE_REGC_GROUP
74
int msg_err_test(void);
75
int multipart_test(void);
76
int txdata_test(void);
78
int transport_udp_test(void);
79
int transport_loop_test(void);
80
int transport_tcp_test(void);
81
int resolve_test(void);
91
int tsx_basic_test(struct tsx_test_param *param);
92
int tsx_uac_test(struct tsx_test_param *param);
93
int tsx_uas_test(struct tsx_test_param *param);
95
/* Transport test helpers (transport_test.c). */
96
int generic_transport_test(pjsip_transport *tp);
97
int transport_send_recv_test( pjsip_transport_type_e tp_type,
98
pjsip_transport *ref_tp,
101
int transport_rt_test( pjsip_transport_type_e tp_type,
102
pjsip_transport *ref_tp,
105
int transport_load_test(char *target_url);
108
int inv_offer_answer_test(void);
110
/* Test main entry */
113
/* Test utilities. */
114
void app_perror(const char *msg, pj_status_t status);
115
int init_msg_logger(void);
116
int msg_logger_set_enabled(pj_bool_t enabled);
117
void flush_events(unsigned duration);
120
void report_ival(const char *name, int value, const char *valname, const char *desc);
121
void report_sval(const char *name, const char* value, const char *valname, const char *desc);
125
extern int log_level;
127
#endif /* __TEST_H__ */