Skip to content

Commit 10ca1f0

Browse files
authored
Merge pull request #44 from thekuwayama/modify__structure_invoke_cmd_testcase
modify: for proper test case
2 parents 05263e7 + 4a4fcc8 commit 10ca1f0

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

matter/src/tlv/parser.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,8 +1092,8 @@ mod tests {
10921092
fn test_complex_structure_invoke_cmd() {
10931093
// This is what we typically get in an invoke command
10941094
let b = [
1095-
0x15, 0x36, 0x0, 0x15, 0x37, 0x0, 0x24, 0x0, 0x2, 0x24, 0x2, 0x6, 0x24, 0x3, 0x1, 0x18,
1096-
0x35, 0x1, 0x18, 0x18, 0x18, 0x18,
1095+
0x15, 0x36, 0x0, 0x15, 0x37, 0x0, 0x25, 0x0, 0x2, 0x0, 0x26, 0x1, 0x6, 0x0, 0x0, 0x0,
1096+
0x26, 0x2, 0x1, 0x0, 0x0, 0x0, 0x18, 0x35, 0x1, 0x18, 0x18, 0x18, 0x18,
10971097
];
10981098

10991099
let root = get_root_node_struct(&b).unwrap();
@@ -1115,24 +1115,24 @@ mod tests {
11151115
cmd_path.find_tag(0).unwrap(),
11161116
TLVElement {
11171117
tag_type: TagType::Context(0),
1118-
element_type: ElementType::U8(2),
1118+
element_type: ElementType::U16(2),
11191119
}
11201120
);
11211121
assert_eq!(
1122-
cmd_path.find_tag(2).unwrap(),
1122+
cmd_path.find_tag(1).unwrap(),
11231123
TLVElement {
1124-
tag_type: TagType::Context(2),
1125-
element_type: ElementType::U8(6),
1124+
tag_type: TagType::Context(1),
1125+
element_type: ElementType::U32(6),
11261126
}
11271127
);
11281128
assert_eq!(
1129-
cmd_path.find_tag(3).unwrap(),
1129+
cmd_path.find_tag(2).unwrap(),
11301130
TLVElement {
1131-
tag_type: TagType::Context(3),
1132-
element_type: ElementType::U8(1),
1131+
tag_type: TagType::Context(2),
1132+
element_type: ElementType::U32(1),
11331133
}
11341134
);
1135-
assert_eq!(cmd_path.find_tag(1), Err(Error::NoTagFound));
1135+
assert_eq!(cmd_path.find_tag(3), Err(Error::NoTagFound));
11361136

11371137
// This is the variable of the invoke command
11381138
assert_eq!(

0 commit comments

Comments
 (0)