Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
| 1 |
#[test] |
| 2 |
fn compile_test() { |
| 3 |
let t = trybuild::TestCases::new(); |
| 4 |
t.compile_fail("tests/compile-fail/*.rs"); |
| 5 |
t.pass("tests/run-pass/*.rs"); |
| 6 |
} |
| 7 |
|
| 8 |
#[test] |
| 9 |
fn test_vec_primitive() { |
| 10 |
use pnet_macros::packet; |
| 11 |
use pnet_macros_support::types::u32be; |
| 12 |
|
| 13 |
#[packet] |
| 14 |
pub struct Test { |
| 15 |
#[length = "4"] |
| 16 |
pub v: Vec<u32be>, |
| 17 |
#[payload] |
| 18 |
#[length = "0"] |
| 19 |
pub payload: Vec<u8>, |
| 20 |
} |
| 21 |
|
| 22 |
let res = TestPacket::new(&[0x00, 0x00, 0x00, 0x00]).unwrap(); |
| 23 |
assert_eq!(res.get_v(), vec![0]); |
| 24 |
} |