mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
Add test for jingle udp transport serialization
This commit is contained in:
parent
1432807f11
commit
13afbfd099
1 changed files with 19 additions and 1 deletions
|
@ -195,6 +195,24 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_serialize_transport() {
|
fn test_serialize_transport() {
|
||||||
assert!(false);
|
let reference: Element =
|
||||||
|
"<transport xmlns='urn:xmpp:jingle:transports:ice-udp:1'><fingerprint xmlns='urn:xmpp:jingle:apps:dtls:0' hash='sha-256' setup='actpass'>02:1A:CC:54:27:AB:EB:9C:53:3F:3E:4B:65:2E:7D:46:3F:54:42:CD:54:F1:7A:03:A2:7D:F9:B0:7F:46:19:B2</fingerprint></transport>"
|
||||||
|
.parse()
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
let elem: Element = "<fingerprint xmlns='urn:xmpp:jingle:apps:dtls:0' hash='sha-256' setup='actpass'>02:1A:CC:54:27:AB:EB:9C:53:3F:3E:4B:65:2E:7D:46:3F:54:42:CD:54:F1:7A:03:A2:7D:F9:B0:7F:46:19:B2</fingerprint>"
|
||||||
|
.parse()
|
||||||
|
.unwrap();
|
||||||
|
let fingerprint = Fingerprint::try_from(elem).unwrap();
|
||||||
|
|
||||||
|
let transport = Transport {
|
||||||
|
pwd: None,
|
||||||
|
ufrag: None,
|
||||||
|
candidates: vec![],
|
||||||
|
fingerprint: Some(fingerprint),
|
||||||
|
};
|
||||||
|
|
||||||
|
let serialized: Element = transport.into();
|
||||||
|
assert_eq!(serialized, reference);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue