test: add some #[track_caller] annotations

pull/706/head
Tamir Duberstein 1 year ago
parent 6f3cce75cf
commit 571c38b1c6
No known key found for this signature in database

@ -93,6 +93,7 @@ fn set_kernel_buffer_element(bpf: &mut Bpf, bytes: &[u8]) {
m.set(0, bytes, 0).unwrap();
}
#[track_caller]
fn result_bytes(bpf: &Bpf) -> Vec<u8> {
let m = Array::<_, TestResult>::try_from(bpf.map("RESULT").unwrap()).unwrap();
let result = m.get(&0, 0).unwrap();

@ -107,6 +107,7 @@ fn use_map_with_rbpf() {
}
}
#[track_caller]
fn bpf_map_update_elem_multimap(map: u64, key: u64, value: u64, _: u64, _: u64) -> u64 {
assert_matches!(map, 0xCAFE00 | 0xCAFE01);
let key = *unsafe { (key as usize as *const u32).as_ref().unwrap() };

Loading…
Cancel
Save