1 /*
2  * Copyright (c) 2017 Fastly, Kazuho Oku
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"), to
6  * deal in the Software without restriction, including without limitation the
7  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8  * sell copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * 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 THE
17  * 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 #ifndef test_h
23 #define test_h
24 
25 #include "quicly.h"
26 #include "quicly/streambuf.h"
27 #include "picotest.h"
28 
29 typedef struct st_test_streambuf_t {
30     quicly_streambuf_t super;
31     struct {
32         int stop_sending;
33         int reset_stream;
34     } error_received;
35     int is_detached;
36 } test_streambuf_t;
37 
38 extern quicly_address_t fake_address;
39 extern int64_t quic_now;
40 extern quicly_context_t quic_ctx;
41 extern quicly_stream_callbacks_t stream_callbacks;
42 extern size_t on_destroy_callcnt;
43 
44 const quicly_cid_plaintext_t *new_master_id(void);
45 extern quicly_stream_open_t stream_open;
46 size_t decode_packets(quicly_decoded_packet_t *decoded, struct iovec *raw, size_t cnt);
47 int buffer_is(ptls_buffer_t *buf, const char *s);
48 size_t transmit(quicly_conn_t *src, quicly_conn_t *dst);
49 int max_data_is_equal(quicly_conn_t *client, quicly_conn_t *server);
50 
51 void test_ranges(void);
52 void test_rate(void);
53 void test_frame(void);
54 void test_maxsender(void);
55 void test_sentmap(void);
56 void test_loss(void);
57 void test_simple(void);
58 void test_lossy(void);
59 void test_stream_concurrency(void);
60 void test_received_cid(void);
61 void test_local_cid(void);
62 void test_retire_cid(void);
63 
64 #endif
65