File tree Expand file tree Collapse file tree 2 files changed +51
-0
lines changed
dc/s2n-quic-dc/src/stream Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,24 @@ thread_local! {
3030 static SERVERS : RefCell <HashMap <SocketAddr , server:: Handle >> = Default :: default ( ) ;
3131}
3232
33+ pub mod read {
34+ use crate :: stream:: recv:: application as recv;
35+
36+ pub use recv:: { AckMode , ReadMode } ;
37+ pub type Reader = recv:: Reader < super :: Subscriber > ;
38+ }
39+
40+ pub mod write {
41+ use crate :: stream:: send:: application as send;
42+
43+ pub type Writer = send:: Writer < super :: Subscriber > ;
44+ }
45+
3346pub type Subscriber = ( Arc < event:: testing:: Subscriber > , event:: tracing:: Subscriber ) ;
3447
3548pub type Stream = application:: Stream < Subscriber > ;
49+ pub use read:: Reader ;
50+ pub use write:: Writer ;
3651
3752const DEFAULT_POOLED : bool = true ;
3853
Original file line number Diff line number Diff line change 11// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22// SPDX-License-Identifier: Apache-2.0
33
4+ use super :: { testing, Protocol } ;
5+
46mod accept_queue;
57mod behavior;
68/// A set of tests ensuring we support a large number of peers.
@@ -12,3 +14,37 @@ mod key_update;
1214mod request_response;
1315mod restart;
1416mod rpc;
17+
18+ /// Shows an endpoint doesn't need an application tokio runtime to be created
19+ #[ test]
20+ fn runtime_free_context_test ( ) {
21+ let _ = testing:: dcquic:: Context :: new_sync ( Protocol :: Udp , "127.0.0.1:0" . parse ( ) . unwrap ( ) ) ;
22+ }
23+
24+ mod sizes {
25+ use core:: mem:: size_of;
26+
27+ #[ test]
28+ fn stream_test ( ) {
29+ assert_eq ! (
30+ size_of:: <crate :: stream:: testing:: Stream >( ) ,
31+ size_of:: <Box <( ) >>( ) * 2
32+ ) ;
33+ }
34+
35+ #[ test]
36+ fn reader_test ( ) {
37+ assert_eq ! (
38+ size_of:: <crate :: stream:: testing:: Reader >( ) ,
39+ size_of:: <Box <( ) >>( )
40+ ) ;
41+ }
42+
43+ #[ test]
44+ fn writer_test ( ) {
45+ assert_eq ! (
46+ size_of:: <crate :: stream:: testing:: Writer >( ) ,
47+ size_of:: <Box <( ) >>( )
48+ ) ;
49+ }
50+ }
You can’t perform that action at this time.
0 commit comments