-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathuper_octet_string.rs
48 lines (40 loc) · 985 Bytes
/
uper_octet_string.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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);
}