~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.1.0/pjsip/src/test/test.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2015-01-07 14:51:16 UTC
  • mfrom: (4.3.5 sid)
  • Revision ID: package-import@ubuntu.com-20150107145116-yxnafinf4lrdvrmx
Tags: 1.4.1-0.1ubuntu1
* Merge with Debian, remaining changes:
 - Drop soprano, nepomuk build-dep
* Drop ubuntu patches, now upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: test.h 3553 2011-05-05 06:14:19Z nanang $ */
2
 
/* 
3
 
 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4
 
 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
5
 
 *
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.
10
 
 *
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.
15
 
 *
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 
19
 
 */
20
 
#ifndef __TEST_H__
21
 
#define __TEST_H__
22
 
 
23
 
#include <pjsip/sip_types.h>
24
 
 
25
 
extern pjsip_endpoint *endpt;
26
 
 
27
 
#define TEST_UDP_PORT       15060
28
 
#define TEST_UDP_PORT_STR   "15060"
29
 
 
30
 
/**
31
 
 * Memory size to use in caching pool.
32
 
 * Default: 2MB
33
 
 */
34
 
#ifndef PJSIP_TEST_MEM_SIZE
35
 
#  define PJSIP_TEST_MEM_SIZE       (2*1024*1024)
36
 
#endif
37
 
 
38
 
 
39
 
 
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
45
 
 
46
 
#define INCLUDE_BENCHMARKS          1
47
 
 
48
 
/*
49
 
 * Include tests that normally would fail under certain gcc
50
 
 * optimization levels.
51
 
 */
52
 
#ifndef INCLUDE_GCC_TEST
53
 
#   define INCLUDE_GCC_TEST         0
54
 
#endif
55
 
 
56
 
 
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
69
 
 
70
 
 
71
 
/* The tests */
72
 
int uri_test(void);
73
 
int msg_test(void);
74
 
int msg_err_test(void);
75
 
int multipart_test(void);
76
 
int txdata_test(void);
77
 
int tsx_bench(void);
78
 
int transport_udp_test(void);
79
 
int transport_loop_test(void);
80
 
int transport_tcp_test(void);
81
 
int resolve_test(void);
82
 
int regc_test(void);
83
 
 
84
 
struct tsx_test_param
85
 
{
86
 
    int type;
87
 
    int port;
88
 
    char *tp_type;
89
 
};
90
 
 
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);
94
 
 
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,
99
 
                              char *target_url,
100
 
                              int *p_usec_rtt);
101
 
int transport_rt_test( pjsip_transport_type_e tp_type,
102
 
                       pjsip_transport *ref_tp,
103
 
                       char *target_url,
104
 
                       int *pkt_lost);
105
 
int transport_load_test(char *target_url);
106
 
 
107
 
/* Invite session */
108
 
int inv_offer_answer_test(void);
109
 
 
110
 
/* Test main entry */
111
 
int  test_main(void);
112
 
 
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);
118
 
 
119
 
 
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);
122
 
 
123
 
 
124
 
/* Settings. */
125
 
extern int log_level;
126
 
 
127
 
#endif  /* __TEST_H__ */