()
| 374 | |
| 375 | #[test] |
| 376 | fn test_view_state_invalid_kind() { |
| 377 | // Build valid v2 bytes but with an invalid kind byte |
| 378 | let mut bytes = Vec::new(); |
| 379 | bytes.extend_from_slice(&1u64.to_le_bytes()); // id |
| 380 | let name = "test"; |
| 381 | bytes.extend_from_slice(&(name.len() as u32).to_le_bytes()); |
| 382 | bytes.extend_from_slice(name.as_bytes()); |
| 383 | bytes.extend_from_slice(&[0u8; 32]); // merkle |
| 384 | bytes.extend_from_slice(&0u64.to_le_bytes()); // change_count |
| 385 | bytes.push(99); // invalid kind |
| 386 | bytes.extend_from_slice(&u64::MAX.to_le_bytes()); // parent (none) |
| 387 | |
| 388 | let result = deserialize_view_state(&bytes); |
| 389 | assert!(result.is_err()); |
| 390 | } |
| 391 | |
| 392 | #[test] |
| 393 | fn test_adj_iterator() { |
nothing calls this directly
no test coverage detected