From 4d383c14d66527e03de70a515e4c8b9408ae5b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=BCller?= Date: Thu, 3 Oct 2024 10:46:11 -0700 Subject: [PATCH] Adjust normalization tests to compare file offsets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some of our normalization tests incorrectly compare the output of normalization (file offsets) with a virtual address. Adjust them to compare apples to apples (i.e., file offsets to file offsets) instead. Refs: #835 Reported-by: Nicolas Savoire Signed-off-by: Daniel Müller --- src/normalize/normalizer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/normalize/normalizer.rs b/src/normalize/normalizer.rs index 07956f80..e9cd659b 100644 --- a/src/normalize/normalizer.rs +++ b/src/normalize/normalizer.rs @@ -479,7 +479,7 @@ mod tests { assert_eq!(normalized.meta.len(), 1); let output = normalized.outputs[0]; - assert_eq!(output.0, sym.addr); + assert_eq!(output.0, sym.file_offset.unwrap()); let meta = &normalized.meta[output.1]; let expected_elf = Elf { build_id: Some(read_elf_build_id(&test_so).unwrap().unwrap()), @@ -527,7 +527,7 @@ mod tests { assert_eq!(normalized.meta.len(), 1); let output = normalized.outputs[0]; - assert_eq!(output.0, sym.addr); + assert_eq!(output.0, sym.file_offset.unwrap()); let meta = &normalized.meta[output.1].as_elf().unwrap(); let expected_build_id = if use_map_files || use_procmap_query { Some(read_elf_build_id(&test_so).unwrap().unwrap())