1 /*
2     Copyright (c) 2010-2012 250bpm s.r.o.
3     Copyright (c) 2010-2011 Other contributors as noted in the AUTHORS file
4 
5     This file is part of Crossroads I/O project.
6 
7     Crossroads I/O is free software; you can redistribute it and/or modify it
8     under the terms of the GNU Lesser General Public License as published by
9     the Free Software Foundation; either version 3 of the License, or
10     (at your option) any later version.
11 
12     Crossroads is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU Lesser General Public License for more details.
16 
17     You should have received a copy of the GNU Lesser General Public License
18     along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #include "testutil.hpp"
22 
23 #if defined XS_HAVE_WINDOWS || defined XS_HAVE_OPENVMS
XS_TEST_MAIN()24 int XS_TEST_MAIN ()
25 {
26     return 0;
27 }
28 #else
29 
XS_TEST_MAIN()30 int XS_TEST_MAIN ()
31 {
32     fprintf (stderr, "reqrep_ipc test running...\n");
33 
34     void *ctx = xs_init ();
35     assert (ctx);
36 
37     void *sb = xs_socket (ctx, XS_REP);
38     assert (sb);
39     int rc = xs_bind (sb, "ipc:///tmp/tester");
40     assert (rc != -1);
41 
42     void *sc = xs_socket (ctx, XS_REQ);
43     assert (sc);
44     rc = xs_connect (sc, "ipc:///tmp/tester");
45     assert (rc != -1);
46 
47     bounce (sb, sc);
48 
49     rc = xs_close (sc);
50     assert (rc == 0);
51 
52     rc = xs_close (sb);
53     assert (rc == 0);
54 
55     rc = xs_term (ctx);
56     assert (rc == 0);
57 
58     return 0 ;
59 }
60 
61 #endif
62