summaryrefslogtreecommitdiff
path: root/toxrtp/tests/test_helper.h
blob: de654743d93b11cec735a096b28fd152436dfcbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*   test_helper.h
 *
 *   Tests support. !Red!
 *
 *
 *   Copyright (C) 2013 Tox project All Rights Reserved.
 *
 *   This file is part of Tox.
 *
 *   Tox is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   Tox is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with Tox.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef _TEST__HELPER_
#define _TEST__HELPER_

#include "../toxrtp_helper.h"

#define RTP_PORT 31003
#define RTP_PORT_LISTEN 31001

#define _SLEEP_INTERVAL 1000

typedef struct arg_s {
    const char*   value;
    struct arg_s* next;
    struct arg_s* prev;

} arg_t;



/* Parses arguments into d-list arg_t */
arg_t*      parse_args ( int argc, char* argv[] );

/* Get a single argument ( i.e. ./test -s |find if has 's' >> | find_arg_simple(_t, "-s") )
 * A little error checking, of course, returns FAILURE if not found and if found returns position
 * where it's found.
 */
int         find_arg_simple ( arg_t* _head, const char* _id );

/* Get a single argument ( i.e. ./test -d 127.0.0.1 |get 'd' value >> | find_arg_duble(_t, "-d") )
 * A little error checking, of course, returns NULL if not found and if found returns value
 * of that argument ( i.e. '127.0.0.1').
 */
const char* find_arg_duble ( arg_t* _head, const char* _id );

#endif /*  _TEST__HELPER_ */