|
|
@ -1463,7 +1463,6 @@ mod tests {
|
|
|
|
map_flags: 5,
|
|
|
|
map_flags: 5,
|
|
|
|
id: 0,
|
|
|
|
id: 0,
|
|
|
|
pinning: PinningType::None,
|
|
|
|
pinning: PinningType::None,
|
|
|
|
..Default::default()
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
assert_eq!(
|
|
|
|
assert_eq!(
|
|
|
@ -1482,7 +1481,6 @@ mod tests {
|
|
|
|
map_flags: 5,
|
|
|
|
map_flags: 5,
|
|
|
|
id: 6,
|
|
|
|
id: 6,
|
|
|
|
pinning: PinningType::ByName,
|
|
|
|
pinning: PinningType::ByName,
|
|
|
|
..Default::default()
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
assert_eq!(parse_map_def("foo", bytes_of(&def)).unwrap(), def);
|
|
|
|
assert_eq!(parse_map_def("foo", bytes_of(&def)).unwrap(), def);
|
|
|
@ -1498,7 +1496,6 @@ mod tests {
|
|
|
|
map_flags: 5,
|
|
|
|
map_flags: 5,
|
|
|
|
id: 6,
|
|
|
|
id: 6,
|
|
|
|
pinning: PinningType::ByName,
|
|
|
|
pinning: PinningType::ByName,
|
|
|
|
..Default::default()
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let mut buf = [0u8; 128];
|
|
|
|
let mut buf = [0u8; 128];
|
|
|
|
unsafe { ptr::write_unaligned(buf.as_mut_ptr() as *mut _, def) };
|
|
|
|
unsafe { ptr::write_unaligned(buf.as_mut_ptr() as *mut _, def) };
|
|
|
@ -1529,7 +1526,6 @@ mod tests {
|
|
|
|
map_flags: 5,
|
|
|
|
map_flags: 5,
|
|
|
|
id: 0,
|
|
|
|
id: 0,
|
|
|
|
pinning: PinningType::None,
|
|
|
|
pinning: PinningType::None,
|
|
|
|
..Default::default()
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
),
|
|
|
|
),
|
|
|
|
"foo"
|
|
|
|
"foo"
|
|
|
@ -1664,7 +1660,7 @@ mod tests {
|
|
|
|
buf.extend(&map_data);
|
|
|
|
buf.extend(&map_data);
|
|
|
|
buf.extend(&map_data);
|
|
|
|
buf.extend(&map_data);
|
|
|
|
// throw in some padding
|
|
|
|
// throw in some padding
|
|
|
|
buf.extend(&[0, 0, 0, 0]);
|
|
|
|
buf.extend([0, 0, 0, 0]);
|
|
|
|
buf.extend(&map_data);
|
|
|
|
buf.extend(&map_data);
|
|
|
|
assert_matches!(
|
|
|
|
assert_matches!(
|
|
|
|
obj.parse_section(fake_section(BpfSectionKind::Maps, "maps", buf.as_slice(),)),
|
|
|
|
obj.parse_section(fake_section(BpfSectionKind::Maps, "maps", buf.as_slice(),)),
|
|
|
@ -2198,7 +2194,6 @@ mod tests {
|
|
|
|
map_flags: BPF_F_RDONLY_PROG,
|
|
|
|
map_flags: BPF_F_RDONLY_PROG,
|
|
|
|
id: 1,
|
|
|
|
id: 1,
|
|
|
|
pinning: PinningType::None,
|
|
|
|
pinning: PinningType::None,
|
|
|
|
..Default::default()
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
section_index: 1,
|
|
|
|
section_index: 1,
|
|
|
|
symbol_index: 1,
|
|
|
|
symbol_index: 1,
|
|
|
|