summaryrefslogtreecommitdiff
path: root/tests/tests.cpp
blob: 1d1ebbe177368192d249974f6f4f06e95b1ebf14 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/*
    Copyright (c) 2012 250bpm s.r.o.
    Copyright (c) 2012 Other contributors as noted in the AUTHORS file

    This file is part of Crossroads project.

    Crossroads is free software; you can redistribute it and/or modify it under
    the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    Crossroads 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 Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

//  This file is used only in MSVC build.
//  It gathers all the tests into a single executable.

#include "testutil.hpp"

#include <assert.h>

#undef XS_TEST_MAIN

#define XS_TEST_MAIN hwm
#include "hwm.cpp"
#undef XS_TEST_MAIN

#define XS_TEST_MAIN invalid_rep
#include "invalid_rep.cpp"
#undef XS_TEST_MAIN

#define XS_TEST_MAIN linger
#include "linger.cpp"
#undef XS_TEST_MAIN

#define XS_TEST_MAIN msg_flags
#include "msg_flags.cpp"
#undef XS_TEST_MAIN

#define XS_TEST_MAIN pair_inproc
#include "pair_inproc.cpp"
#undef XS_TEST_MAIN

#define XS_TEST_MAIN pair_ipc
#include "pair_ipc.cpp"
#undef XS_TEST_MAIN

#define XS_TEST_MAIN pair_tcp
#include "pair_tcp.cpp"
#undef XS_TEST_MAIN

#define XS_TEST_MAIN reconnect
#include "reconnect.cpp"
#undef XS_TEST_MAIN

#define XS_TEST_MAIN reqrep_device
#include "reqrep_device.cpp"
#undef XS_TEST_MAIN

#define XS_TEST_MAIN reqrep_inproc
#include "reqrep_inproc.cpp"
#undef XS_TEST_MAIN

#define XS_TEST_MAIN reqrep_ipc
#include "reqrep_ipc.cpp"
#undef XS_TEST_MAIN

#define XS_TEST_MAIN reqrep_tcp
#include "reqrep_tcp.cpp"
#undef XS_TEST_MAIN

#define XS_TEST_MAIN shutdown_stress
#include "shutdown_stress.cpp"
#undef XS_TEST_MAIN

#define XS_TEST_MAIN sub_forward
#include "sub_forward.cpp"
#undef XS_TEST_MAIN

#define XS_TEST_MAIN timeo
#include "timeo.cpp"
#undef XS_TEST_MAIN

#define XS_TEST_MAIN max_sockets
#include "max_sockets.cpp"
#undef XS_TEST_MAIN

#define XS_TEST_MAIN reentrant
#include "reentrant.cpp"
#undef XS_TEST_MAIN

#define XS_TEST_MAIN emptyctx
#include "emptyctx.cpp"
#undef XS_TEST_MAIN

int main ()
{
    int rc;

    rc = hwm ();
    assert (rc == 0);
    rc = invalid_rep ();
    assert (rc == 0);
    rc = linger ();
    assert (rc == 0);
    rc = msg_flags ();
    assert (rc == 0);
    rc = pair_inproc ();
    assert (rc == 0);
    rc = pair_ipc ();
    assert (rc == 0);
    rc = reconnect ();
    assert (rc == 0);
    rc = reqrep_device ();
    assert (rc == 0);
    rc = reqrep_inproc ();
    assert (rc == 0);
    rc = reqrep_ipc ();
    assert (rc == 0);
    rc = reqrep_tcp ();
    assert (rc == 0);
    rc = shutdown_stress ();
    assert (rc == 0);
    rc = sub_forward ();
    assert (rc == 0);
    rc = timeo ();
    assert (rc == 0);
    rc = max_sockets ();
    assert (rc == 0);
    rc = reentrant ();
    assert (rc == 0);
    rc = emptyctx ();
    assert (rc == 0);

    fprintf (stderr, "SUCCESS\n");
    xs_sleep (1);

    return 0;
}