Skip to content

Commit

Permalink
Use read_elf_build_id() more
Browse files Browse the repository at this point in the history
This change switches two uses of
DefaultBuildIdReader::read_build_id_from_elf() over to using the simpler
read_elf_build_id() API.

Signed-off-by: Daniel Müller <deso@posteo.net>
  • Loading branch information
d-e-s-o committed Sep 25, 2023
1 parent 5741a20 commit 00b4391
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/normalize/normalizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ mod tests {
use crate::inspect::FindAddrOpts;
use crate::inspect::SymType;
use crate::mmap::Mmap;
use crate::normalize::buildid::BuildIdReader;
use crate::normalize::buildid::DefaultBuildIdReader;
use crate::normalize::buildid::read_elf_build_id;
use crate::normalize::ApkElf;
use crate::normalize::Elf;
use crate::normalize::Unknown;
Expand Down Expand Up @@ -235,11 +234,7 @@ mod tests {
.join("data")
.join("libtest-so.so");
let expected_elf = Elf {
build_id: Some(
DefaultBuildIdReader::read_build_id_from_elf(&so_path)
.unwrap()
.unwrap(),
),
build_id: Some(read_elf_build_id(&so_path).unwrap().unwrap()),
path: so_path,
_non_exhaustive: (),
};
Expand Down Expand Up @@ -305,11 +300,7 @@ mod tests {
let expected = ApkElf {
apk_path: test_zip,
elf_path: PathBuf::from(so_name),
elf_build_id: Some(
DefaultBuildIdReader::read_build_id_from_elf(&so_path)
.unwrap()
.unwrap(),
),
elf_build_id: Some(read_elf_build_id(&so_path).unwrap().unwrap()),
_non_exhaustive: (),
};
assert_eq!(meta, &UserAddrMeta::ApkElf(expected));
Expand Down

0 comments on commit 00b4391

Please sign in to comment.