Skip to content

Commit

Permalink
moq-transport: Update SETUP message tests
Browse files Browse the repository at this point in the history
  • Loading branch information
englishm committed Nov 3, 2024
1 parent 2151545 commit 54ae8d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions moq-transport/src/setup/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ mod tests {
fn encode_decode() {
let mut buf = BytesMut::new();
let client = Client {
versions: [Version::DRAFT_03].into(),
versions: [Version::DRAFT_06].into(),
role: Role::Both,
params: Params::default(),
};

client.encode(&mut buf).unwrap();
assert_eq!(
buf.to_vec(),
vec![0x40, 0x40, 0x01, 0xC0, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x03]
vec![0x40, 0x40, 0x0D, 0x01, 0xC0, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x06, 0x01, 0x00, 0x01, 0x03]
);

let decoded = Client::decode(&mut buf).unwrap();
Expand Down
5 changes: 2 additions & 3 deletions moq-transport/src/setup/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,19 @@ mod tests {
use crate::setup::Role;
use bytes::BytesMut;

// TODO: Update this test to use the draft 06 version
#[test]
fn encode_decode() {
let mut buf = BytesMut::new();
let client = Server {
version: Version::DRAFT_03,
version: Version::DRAFT_06,
role: Role::Both,
params: Params::default(),
};

client.encode(&mut buf).unwrap();
assert_eq!(
buf.to_vec(),
vec![0x40, 0x41, 0xC0, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x03]
vec![0x40, 0x41, 0x0C, 0xC0, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x06, 0x01, 0x00, 0x01, 0x03]
);

let decoded = Server::decode(&mut buf).unwrap();
Expand Down

0 comments on commit 54ae8d9

Please sign in to comment.