annotate tests/testsctp.c @ 706:4ffbc9f1e922

Large UNTESTED commit with the following changes: * Improved DiameterIdentity handling (esp. interationalization issues), and improve efficiency of some string operations in peers, sessions, and dictionary modules (closes #7) * Cleanup in the session module to free only unreferenced sessions (#16) * Removed fd_cpu_flush_cache(), replaced by more robust alternatives. * Improved peer state machine algorithm to counter SCTP multistream race condition.
author Sebastien Decugis <sdecugis@nict.go.jp>
date Wed, 09 Feb 2011 15:26:58 +0900
parents 2e94ef0515d7
children 5d8ac5da7092
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
477
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
1 /*********************************************************************************************************
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
2 * Software License Agreement (BSD License) *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
3 * Author: Sebastien Decugis <sdecugis@nict.go.jp> *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
4 * *
662
2e94ef0515d7 Updated copyright information
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 658
diff changeset
5 * Copyright (c) 2011, WIDE Project and NICT *
477
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
6 * All rights reserved. *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
7 * *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
8 * Redistribution and use of this software in source and binary forms, with or without modification, are *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
9 * permitted provided that the following conditions are met: *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
10 * *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
11 * * Redistributions of source code must retain the above *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
12 * copyright notice, this list of conditions and the *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
13 * following disclaimer. *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
14 * *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
15 * * Redistributions in binary form must reproduce the above *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
16 * copyright notice, this list of conditions and the *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
17 * following disclaimer in the documentation and/or other *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
18 * materials provided with the distribution. *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
19 * *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
20 * * Neither the name of the WIDE Project or NICT nor the *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
21 * names of its contributors may be used to endorse or *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
22 * promote products derived from this software without *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
23 * specific prior written permission of WIDE Project and *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
24 * NICT. *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
25 * *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
27 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
28 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
29 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
32 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
33 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
34 *********************************************************************************************************/
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
35
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
36 #include "tests.h"
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
37
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
38 #include <cnxctx.h>
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
39
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
40 #ifndef TEST_PORT
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
41 #define TEST_PORT 3868
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
42 #endif /* TEST_PORT */
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
43
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
44 #ifndef NB_STREAMS
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
45 #define NB_STREAMS 10
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
46 #endif /* NB_STREAMS */
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
47
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
48
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
49
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
50 /* Main test routine */
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
51 int main(int argc, char *argv[])
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
52 {
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
53 #ifdef DISABLE_SCTP
485
2b0578a5c589 Fix compilation warning
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 482
diff changeset
54 INIT_FD();
477
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
55 /* In this case, we don't perform this simple test */
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
56 PASSTEST();
482
3b7d579e9507 Remove compilation warnings if DISABLE_SCTP
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 479
diff changeset
57 #else /* DISABLE_SCTP */
706
4ffbc9f1e922 Large UNTESTED commit with the following changes:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
58 struct cnxctx cli, srv; /* we use only their cc_socket & cc_state */
4ffbc9f1e922 Large UNTESTED commit with the following changes:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
59 int sock;
477
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
60 char buf1[]="abcdef";
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
61 char *buf2;
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
62 size_t sz;
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
63 struct fd_list eps = FD_LIST_INITIALIZER(eps);
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
64 uint16_t str;
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
65 int ev;
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
66
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
67 /* Initialize the server addresses */
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
68 {
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
69 struct addrinfo hints, *ai, *aip;
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
70 memset(&hints, 0, sizeof(hints));
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
71 hints.ai_flags = AI_NUMERICSERV;
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
72 hints.ai_family = AF_INET;
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
73 CHECK( 0, getaddrinfo("localhost", _stringize(TEST_PORT), &hints, &ai) );
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
74 aip = ai;
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
75 while (aip) {
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
76 CHECK( 0, fd_ep_add_merge( &eps, aip->ai_addr, aip->ai_addrlen, EP_FL_DISC | EP_ACCEPTALL ));
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
77 aip = aip->ai_next;
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
78 };
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
79 freeaddrinfo(ai);
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
80 }
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
81
706
4ffbc9f1e922 Large UNTESTED commit with the following changes:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
82 memset(&cli, 0, sizeof(cli));
4ffbc9f1e922 Large UNTESTED commit with the following changes:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
83 memset(&srv, 0, sizeof(srv));
4ffbc9f1e922 Large UNTESTED commit with the following changes:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
84
477
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
85 /* First, initialize the daemon modules */
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
86 INIT_FD();
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
87
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
88 /* Restrain the # of streams */
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
89 fd_g_config->cnf_sctp_str = NB_STREAMS;
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
90
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
91 /* Create the server socket */
478
b65f32c20e6d Fix for FreeBSD which is less tolerant
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 477
diff changeset
92 CHECK( 0, fd_sctp_create_bind_server( &sock, AF_INET6, &eps, TEST_PORT ));
477
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
93
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
94 /* Accept incoming clients */
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
95 CHECK( 0, fd_sctp_listen( sock ));
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
96
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
97 /* Now, create the client socket */
706
4ffbc9f1e922 Large UNTESTED commit with the following changes:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
98 CHECK( 0, fd_sctp_client( &cli.cc_socket, 0, TEST_PORT, &eps ));
477
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
99
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
100 /* Accept this connection */
706
4ffbc9f1e922 Large UNTESTED commit with the following changes:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
101 srv.cc_socket = accept(sock, NULL, NULL);
477
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
102
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
103 /* Send a first message */
706
4ffbc9f1e922 Large UNTESTED commit with the following changes:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
104 CHECK( 0, fd_sctp_sendstr(&srv, 1, (uint8_t *)buf1, sizeof(buf1) ) );
4ffbc9f1e922 Large UNTESTED commit with the following changes:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
105 CHECK( 0, srv.cc_state);
477
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
106
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
107 /* Receive this message */
479
a186743b89a3 Allow FDEVP_CNX_EP_CHANGE to occur in the test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 478
diff changeset
108 redo1:
706
4ffbc9f1e922 Large UNTESTED commit with the following changes:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
109 CHECK( 0, fd_sctp_recvmeta(&cli, &str, (uint8_t **)&buf2, &sz, &ev) );
479
a186743b89a3 Allow FDEVP_CNX_EP_CHANGE to occur in the test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 478
diff changeset
110 if (ev == FDEVP_CNX_EP_CHANGE)
a186743b89a3 Allow FDEVP_CNX_EP_CHANGE to occur in the test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 478
diff changeset
111 goto redo1;
477
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
112 CHECK( FDEVP_CNX_MSG_RECV, ev);
706
4ffbc9f1e922 Large UNTESTED commit with the following changes:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
113 CHECK( 0, cli.cc_state);
477
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
114 CHECK( 1, str);
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
115 CHECK( sizeof(buf1), sz );
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
116 CHECK( 0, memcmp(buf1, buf2, sz) );
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
117 free(buf2); buf2 = NULL;
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
118
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
119 /* Send in the other direction */
706
4ffbc9f1e922 Large UNTESTED commit with the following changes:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
120 CHECK( 0, fd_sctp_sendstr(&cli, 2, (uint8_t *)buf1, sizeof(buf1)) );
4ffbc9f1e922 Large UNTESTED commit with the following changes:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
121 CHECK( 0, cli.cc_state);
477
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
122
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
123 /* Receive this message */
479
a186743b89a3 Allow FDEVP_CNX_EP_CHANGE to occur in the test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 478
diff changeset
124 redo2:
706
4ffbc9f1e922 Large UNTESTED commit with the following changes:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
125 CHECK( 0, fd_sctp_recvmeta(&srv, &str, (uint8_t **)&buf2, &sz, &ev) );
479
a186743b89a3 Allow FDEVP_CNX_EP_CHANGE to occur in the test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 478
diff changeset
126 if (ev == FDEVP_CNX_EP_CHANGE)
a186743b89a3 Allow FDEVP_CNX_EP_CHANGE to occur in the test
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 478
diff changeset
127 goto redo2;
477
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
128 CHECK( FDEVP_CNX_MSG_RECV, ev);
706
4ffbc9f1e922 Large UNTESTED commit with the following changes:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 662
diff changeset
129 CHECK( 0, srv.cc_state);
477
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
130 CHECK( 2, str);
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
131 CHECK( sizeof(buf1), sz );
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
132 CHECK( 0, memcmp(buf1, buf2, sz) );
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
133 free(buf2); buf2 = NULL;
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
134
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
135 /* That's all for the tests yet */
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
136 PASSTEST();
482
3b7d579e9507 Remove compilation warnings if DISABLE_SCTP
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 479
diff changeset
137 #endif /* DISABLE_SCTP */
477
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
138 }
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
139
"Welcome to our mercurial repository"