1 | #![allow (clippy::upper_case_acronyms)] |
2 | #![allow (missing_docs)] |
3 | |
4 | #[macro_use ] |
5 | mod macros; |
6 | |
7 | pub(crate) mod alert; |
8 | pub(crate) mod base; |
9 | pub(crate) mod ccs; |
10 | pub(crate) mod codec; |
11 | pub(crate) mod deframer; |
12 | pub(crate) mod enums; |
13 | pub(crate) mod fragmenter; |
14 | pub(crate) mod handshake; |
15 | pub(crate) mod message; |
16 | pub(crate) mod persist; |
17 | |
18 | #[cfg (test)] |
19 | mod handshake_test; |
20 | |
21 | #[cfg (test)] |
22 | mod message_test; |
23 | |
24 | #[cfg (test)] |
25 | mod tests { |
26 | use super::codec::Reader; |
27 | use super::message::{Message, OpaqueMessage}; |
28 | |
29 | #[test ] |
30 | fn smoketest() { |
31 | let bytes = include_bytes!("handshake-test.1.bin" ); |
32 | let mut r = Reader::init(bytes); |
33 | |
34 | while r.any_left() { |
35 | let m = OpaqueMessage::read(&mut r).unwrap(); |
36 | |
37 | let out = m.clone().encode(); |
38 | assert!(!out.is_empty()); |
39 | |
40 | Message::try_from(m.into_plain_message()).unwrap(); |
41 | } |
42 | } |
43 | } |
44 | |