|
|
@ -147,7 +147,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: None,
|
|
|
|
fd: None,
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
assert_matches!(
|
|
|
|
assert_matches!(
|
|
|
|
HashMap::<_, u8, u32>::new(&map),
|
|
|
|
HashMap::<_, u8, u32>::new(&map),
|
|
|
@ -164,7 +163,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: None,
|
|
|
|
fd: None,
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
assert_matches!(
|
|
|
|
assert_matches!(
|
|
|
|
HashMap::<_, u32, u16>::new(&map),
|
|
|
|
HashMap::<_, u32, u16>::new(&map),
|
|
|
@ -181,7 +179,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: None,
|
|
|
|
fd: None,
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
let map = Map::Array(map_data);
|
|
|
|
let map = Map::Array(map_data);
|
|
|
@ -197,7 +194,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: None,
|
|
|
|
fd: None,
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
let map = Map::HashMap(map_data);
|
|
|
|
let map = Map::HashMap(map_data);
|
|
|
@ -216,7 +212,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: None,
|
|
|
|
fd: None,
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
assert_matches!(
|
|
|
|
assert_matches!(
|
|
|
@ -231,7 +226,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: Some(42),
|
|
|
|
fd: Some(42),
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
assert!(HashMap::<_, u32, u32>::new(&mut map).is_ok());
|
|
|
|
assert!(HashMap::<_, u32, u32>::new(&mut map).is_ok());
|
|
|
@ -243,7 +237,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: Some(42),
|
|
|
|
fd: Some(42),
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
let map = Map::HashMap(map_data);
|
|
|
|
let map = Map::HashMap(map_data);
|
|
|
@ -268,7 +261,6 @@ mod tests {
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
fd: Some(42),
|
|
|
|
fd: Some(42),
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
let map = Map::HashMap(map_data);
|
|
|
|
let map = Map::HashMap(map_data);
|
|
|
@ -284,7 +276,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: Some(42),
|
|
|
|
fd: Some(42),
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let mut hm = HashMap::<_, u32, u32>::new(&mut map).unwrap();
|
|
|
|
let mut hm = HashMap::<_, u32, u32>::new(&mut map).unwrap();
|
|
|
|
|
|
|
|
|
|
|
@ -308,7 +299,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: Some(42),
|
|
|
|
fd: Some(42),
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let mut hm = HashMap::<_, u32, u32>::new(&mut map).unwrap();
|
|
|
|
let mut hm = HashMap::<_, u32, u32>::new(&mut map).unwrap();
|
|
|
|
|
|
|
|
|
|
|
@ -329,7 +319,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: Some(42),
|
|
|
|
fd: Some(42),
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let mut hm = HashMap::<_, u32, u32>::new(&mut map).unwrap();
|
|
|
|
let mut hm = HashMap::<_, u32, u32>::new(&mut map).unwrap();
|
|
|
|
|
|
|
|
|
|
|
@ -344,7 +333,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: Some(42),
|
|
|
|
fd: Some(42),
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let mut hm = HashMap::<_, u32, u32>::new(&mut map).unwrap();
|
|
|
|
let mut hm = HashMap::<_, u32, u32>::new(&mut map).unwrap();
|
|
|
|
|
|
|
|
|
|
|
@ -368,7 +356,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: Some(42),
|
|
|
|
fd: Some(42),
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let mut hm = HashMap::<_, u32, u32>::new(&mut map).unwrap();
|
|
|
|
let mut hm = HashMap::<_, u32, u32>::new(&mut map).unwrap();
|
|
|
|
|
|
|
|
|
|
|
@ -382,7 +369,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: Some(42),
|
|
|
|
fd: Some(42),
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
|
|
|
|
|
|
|
@ -405,7 +391,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: Some(42),
|
|
|
|
fd: Some(42),
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
|
|
|
|
|
|
|
@ -442,7 +427,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: Some(42),
|
|
|
|
fd: Some(42),
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
let keys = hm.keys().collect::<Result<Vec<_>, _>>();
|
|
|
|
let keys = hm.keys().collect::<Result<Vec<_>, _>>();
|
|
|
@ -491,7 +475,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: Some(42),
|
|
|
|
fd: Some(42),
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
|
|
|
|
|
|
|
@ -524,7 +507,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: Some(42),
|
|
|
|
fd: Some(42),
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
|
|
|
|
|
|
|
@ -562,7 +544,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: Some(42),
|
|
|
|
fd: Some(42),
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
let items = hm.iter().collect::<Result<Vec<_>, _>>().unwrap();
|
|
|
|
let items = hm.iter().collect::<Result<Vec<_>, _>>().unwrap();
|
|
|
@ -600,7 +581,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: Some(42),
|
|
|
|
fd: Some(42),
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
|
|
|
|
|
|
|
@ -639,7 +619,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: Some(42),
|
|
|
|
fd: Some(42),
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
|
|
|
|
|
|
|
@ -687,7 +666,6 @@ mod tests {
|
|
|
|
obj: new_obj_map(),
|
|
|
|
obj: new_obj_map(),
|
|
|
|
fd: Some(42),
|
|
|
|
fd: Some(42),
|
|
|
|
pinned: false,
|
|
|
|
pinned: false,
|
|
|
|
btf_fd: None,
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
let hm = HashMap::<_, u32, u32>::new(&map).unwrap();
|
|
|
|
|
|
|
|
|
|
|
|