1 /*
2     Copyright 2016 Garrett D'Amore <garrett@damore.org>
3 
4     Permission is hereby granted, free of charge, to any person obtaining a copy
5     of this software and associated documentation files (the "Software"),
6     to deal in the Software without restriction, including without limitation
7     the rights to use, copy, modify, merge, publish, distribute, sublicense,
8     and/or sell copies of the Software, and to permit persons to whom
9     the Software is furnished to do so, subject to the following conditions:
10 
11     The above copyright notice and this permission notice shall be included
12     in all copies or substantial portions of the Software.
13 
14     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17     THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20     IN THE SOFTWARE.
21 */
22 
23 #include "../src/nn.h"
24 #include "../src/pair.h"
25 
26 #include "testutil.h"
27 
main(NN_UNUSED int argc,const NN_UNUSED char * argv[])28 int main (NN_UNUSED int argc, const NN_UNUSED char *argv[])
29 {
30     int sb;
31     int sc1;
32     int sc2;
33 
34     sb = test_socket (AF_SP, NN_PAIR);
35     test_bind (sb, "inproc://pair");
36     sc1 = test_socket (AF_SP, NN_PAIR);
37     test_connect (sc1, "inproc://pair");
38     sc2 = test_socket (AF_SP, NN_PAIR);
39     test_connect (sc2, "inproc://pair");
40 
41     test_send (sb, "HELLO");
42     test_recv (sc1, "HELLO");
43 
44     test_send (sc1, "THERE");
45     test_recv (sb, "THERE");
46     return 0;
47 }
48 
49