diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /third_party/rust/webrtc-sdp/src/network_tests.rs | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/webrtc-sdp/src/network_tests.rs')
-rw-r--r-- | third_party/rust/webrtc-sdp/src/network_tests.rs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/third_party/rust/webrtc-sdp/src/network_tests.rs b/third_party/rust/webrtc-sdp/src/network_tests.rs new file mode 100644 index 0000000000..4380894899 --- /dev/null +++ b/third_party/rust/webrtc-sdp/src/network_tests.rs @@ -0,0 +1,33 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +use super::*; + +#[test] +fn test_parse_network_type() -> Result<(), SdpParserInternalError> { + parse_network_type("iN")?; + + assert!(parse_network_type("").is_err()); + assert!(parse_network_type("FOO").is_err()); + Ok(()) +} + +#[test] +fn test_parse_address_type() -> Result<(), SdpParserInternalError> { + let ip4 = parse_address_type("iP4")?; + assert_eq!(ip4, AddressType::IpV4); + let ip6 = parse_address_type("Ip6")?; + assert_eq!(ip6, AddressType::IpV6); + + assert!(parse_address_type("").is_err()); + assert!(parse_address_type("IP5").is_err()); + Ok(()) +} + +#[test] +fn test_parse_unicast_address() -> Result<(), SdpParserInternalError> { + parse_unicast_address("127.0.0.1")?; + parse_unicast_address("::1")?; + Ok(()) +} |