-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for fragmented OCTET STRINGs
- Loading branch information
1 parent
5061379
commit ee74d2b
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
mod test_utils; | ||
|
||
use test_utils::*; | ||
|
||
asn_to_rust!( | ||
r#"TransparentConsts DEFINITIONS AUTOMATIC TAGS ::= | ||
BEGIN | ||
Container ::= SEQUENCE { | ||
value OCTET STRING | ||
} | ||
END"# | ||
); | ||
|
||
#[test] | ||
pub fn octet_string_fragmented_16383() { | ||
octet_string_fragmented( | ||
16383, | ||
8 * 16385, | ||
include_bytes!("uper_octet_string_fragmented_16383.uper"), | ||
); | ||
} | ||
|
||
#[test] | ||
pub fn octet_string_fragmented_16384() { | ||
octet_string_fragmented( | ||
16384, | ||
8 * 16386, | ||
include_bytes!("uper_octet_string_fragmented_16384.uper"), | ||
); | ||
} | ||
|
||
#[test] | ||
pub fn octet_string_fragmented_65536() { | ||
octet_string_fragmented( | ||
65536, | ||
8 * 65538, | ||
include_bytes!("uper_octet_string_fragmented_65536.uper"), | ||
); | ||
} | ||
|
||
pub fn octet_string_fragmented(value_len: usize, bits: usize, bytes: &[u8]) { | ||
let container = Container { | ||
value: vec![0u8; value_len], | ||
}; | ||
serialize_and_deserialize_uper(bits, bytes, &container); | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.