From b30572612b1fd630ff660c50e1292fe04ca6d04f Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 23 Oct 2021 15:42:27 +0200 Subject: [PATCH] parsers/ssma: ssrc-id is actually an u32. Now that this XEP has an XML schema[1], it should be more evident. [1] https://github.com/xsf/xeps/pull/1120 --- parsers/src/jingle_ssma.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/parsers/src/jingle_ssma.rs b/parsers/src/jingle_ssma.rs index 877a8b1..9632a97 100644 --- a/parsers/src/jingle_ssma.rs +++ b/parsers/src/jingle_ssma.rs @@ -9,7 +9,7 @@ generate_element!( Source, "source", JINGLE_SSMA, attributes: [ /// Maps to the ssrc-id parameter. - id: Required = "ssrc", + id: Required = "ssrc", ], children: [ /// List of attributes for this source. @@ -19,7 +19,7 @@ generate_element!( impl Source { /// Create a new SSMA Source element. - pub fn new(id: String) -> Source { + pub fn new(id: u32) -> Source { Source { id, parameters: Vec::new(), @@ -61,7 +61,7 @@ mod tests { #[cfg(target_pointer_width = "32")] #[test] fn test_size() { - assert_size!(Source, 24); + assert_size!(Source, 16); assert_size!(Parameter, 24); assert_size!(Group, 24); } @@ -69,7 +69,7 @@ mod tests { #[cfg(target_pointer_width = "64")] #[test] fn test_size() { - assert_size!(Source, 48); + assert_size!(Source, 32); assert_size!(Parameter, 48); assert_size!(Group, 48); } @@ -84,7 +84,7 @@ mod tests { .parse() .unwrap(); let mut ssrc = Source::try_from(elem).unwrap(); - assert_eq!(ssrc.id, "1656081975"); + assert_eq!(ssrc.id, 1656081975); assert_eq!(ssrc.parameters.len(), 2); let parameter = ssrc.parameters.pop().unwrap(); assert_eq!(parameter.name, "msid"); @@ -110,8 +110,8 @@ mod tests { assert_eq!(group.semantics, "FID"); assert_eq!(group.sources.len(), 2); let source = group.sources.pop().unwrap(); - assert_eq!(source.id, "386328120"); + assert_eq!(source.id, 386328120); let source = group.sources.pop().unwrap(); - assert_eq!(source.id, "2301230316"); + assert_eq!(source.id, 2301230316); } }