diff options
| author | Max Audron <audron@cocaine.farm> | 2020-01-17 16:03:59 +0100 |
|---|---|---|
| committer | Max Audron <audron@cocaine.farm> | 2020-01-17 16:03:59 +0100 |
| commit | 7cde729ee4b8f618727cd46ec2a2498595b5a058 (patch) | |
| tree | 9b0ef90ebcb052c2540270123454d1c9f6be8def /src/tests/handshake_types.rs | |
| parent | add error handling (diff) | |
add ClientLogin
Diffstat (limited to 'src/tests/handshake_types.rs')
| -rw-r--r-- | src/tests/handshake_types.rs | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/tests/handshake_types.rs b/src/tests/handshake_types.rs index a664128..701b871 100644 --- a/src/tests/handshake_types.rs +++ b/src/tests/handshake_types.rs @@ -18,18 +18,25 @@ pub fn serialize_variantmap() { pub fn read_variantmap() { use std::io::Cursor; - let test_bytes: Vec<u8> = vec![0, 0, 0, 39, 0, 0, 0, 10, 0, 0, 0, 10, 0, + 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, 1]; + 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 mut buf: Vec<u8> = [0; 43].to_vec(); + let mut buf: Vec<u8> = [0; 78].to_vec(); let len = VariantMap::read(&mut Cursor::new(&test_bytes), &mut buf).unwrap(); - assert_eq!(len, 43); + assert_eq!(len, 78); - let result_bytes: Vec<u8> = vec![0, 0, 0, 39, 0, 0, 0, 10, 0, 0, 0, 10, 0, + let result_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, 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]; assert_eq!(buf, result_bytes); } @@ -50,8 +57,11 @@ pub fn deserialize_variantmap() { #[test] pub fn deserialize_variantmap_utf8() { let test_bytes: &[u8] = &[0, 0, 0, 29, 0, 0, 0, 10, 0, 0, 0, 12, 0, - 0, 0, 0, 10, 67, 111, 110, 102, 105, 103, 117, 114, 101, 100, - 0, 0, 0, 1, 0, 1, 0, 0, 0, 1]; + 0, 0, 0, 10, 67, 111, 110, 102, 105, 103, 117, 114, 101, 100, + 0, 0, 0, 1, 0, 1, +// 0, 0, 0, 10, 67, 111, 110, 102, 105, 103, 117, 114 +// 0, 0, 0, 1, 0, 1, + 0, 0, 0, 1]; let mut test_variantmap = VariantMap::new(); test_variantmap.insert("Configured".to_string(), Variant::bool(true)); |
