aboutsummaryrefslogtreecommitdiff
path: root/src/tests/handshake_types.rs
diff options
context:
space:
mode:
authorMax Audron <audron@cocaine.farm>2020-01-20 16:13:28 +0100
committerMax Audron <audron@cocaine.farm>2020-01-20 16:13:28 +0100
commit6cde3378267abfacdf770317844bc916545f8582 (patch)
tree8c2abccc593a8782786a8d00e2f0fd44685c0538 /src/tests/handshake_types.rs
parentupdate (diff)
update
Diffstat (limited to 'src/tests/handshake_types.rs')
-rw-r--r--src/tests/handshake_types.rs45
1 files changed, 34 insertions, 11 deletions
diff --git a/src/tests/handshake_types.rs b/src/tests/handshake_types.rs
index 701b871..227bdad 100644
--- a/src/tests/handshake_types.rs
+++ b/src/tests/handshake_types.rs
@@ -18,25 +18,48 @@ pub fn serialize_variantmap() {
pub fn read_variantmap() {
use std::io::Cursor;
- let test_bytes: Vec<u8> = vec![0, 0, 0, 67, 0, 0, 0, 10, 0, 0, 0, 10, 0,
- 0, 0, 0, 20, 0, 67, 0, 111, 0, 110, 0, 102, 0, 105, 0, 103, 0, 117, 0, 114, 0, 101, 0, 100,
- 0, 0, 0, 1, 0, 1,
- 0, 0, 0, 10, 0,
- 0, 0, 0, 20, 0, 67, 0, 111, 0, 110, 0, 102, 0, 105, 0, 103, 0, 117, 0, 114, 0, 101, 0, 100,
- 0, 0, 0, 1, 0, 1,
- 0, 0, 0, 1];
+ let test_bytes: Vec<u8> = vec![
+ // len
+ 0, 0, 0, 74,
+ // var
+ 0, 0, 0, 10, // 4
+ // var
+ 0, 0, 0, 10, 0, // 5
+ // strlen, str
+ 0, 0, 0, 20, 0, 67, 0, 111, 0, 110, 0, 102, 0, 105, 0, 103, 0, 117, 0, 114, 0, 101, 0, 100, // 24
+ // bool
+ 0, 0, 0, 1, 0, 1, // 6
+ // var
+ 0, 0, 0, 10, 0, // 5
+ // strlen, str
+ 0, 0, 0, 20, 0, 67, 0, 111, 0, 110, 0, 102, 0, 105, 0, 103, 0, 117, 0, 114, 0, 101, 0, 100, // 24
+ // bool
+ 0, 0, 0, 1, 0, 1, //6
+ // extra
+ 0, 0, 0, 1];
let mut buf: Vec<u8> = [0; 78].to_vec();
let len = VariantMap::read(&mut Cursor::new(&test_bytes), &mut buf).unwrap();
assert_eq!(len, 78);
- let result_bytes: Vec<u8> = vec![0, 0, 0, 67, 0, 0, 0, 10, 0, 0, 0, 10, 0,
+ let result_bytes: Vec<u8> = vec![
+ // len
+ 0, 0, 0, 74,
+ // var
+ 0, 0, 0, 10,
+ // var
+ 0, 0, 0, 10, 0,
+ // strlen, str
0, 0, 0, 20, 0, 67, 0, 111, 0, 110, 0, 102, 0, 105, 0, 103, 0, 117, 0, 114, 0, 101, 0, 100,
- 0, 0, 0, 1, 0, 1,
- 0, 0, 0, 10, 0,
+ // bool
+ 0, 0, 0, 1, 0, 1,
+ // var
+ 0, 0, 0, 10, 0,
+ // strlen, str
0, 0, 0, 20, 0, 67, 0, 111, 0, 110, 0, 102, 0, 105, 0, 103, 0, 117, 0, 114, 0, 101, 0, 100,
- 0, 0, 0, 1, 0, 1];
+ // bool
+ 0, 0, 0, 1, 0, 1];
assert_eq!(buf, result_bytes);
}
96fb4c8f0da9e4c2a89dc9&follow=1'>switch to https url for tanka util libMax Audron-2/+2 2021-06-05bump version to 1.0.2Max Audron-2/+2 2021-06-05add tanka ci configurationMax Audron-1/+1 2021-06-05ready tanka deploy for CIMax Audron-32/+69 2021-06-05remove tanka vendoringMax Audron-27651/+0 2021-05-26Release 1.0.1Max Audron-3/+3 2021-05-26fix log breaking once buffer fullMax Audron-2/+33 the log_msg function was poping the newest message and replacing it with the newest message, it should be poping the oldest messages. 2021-05-16add deployment stuffMax Audron-6/+27786 2021-05-15add container buildMax Audron-2/+35