Skip to content

Commit

Permalink
Add test for deleting duplicate rpaths
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocab committed May 15, 2021
1 parent 6c24a08 commit f73089c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Binary file added test/bin/x86_64/libdupe.dylib
Binary file not shown.
5 changes: 5 additions & 0 deletions test/test_macho.rb
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,10 @@ def test_delete_rpath
end
end

groups << ["libdupe.dylib", "libdupe_actual.dylib"].map do |fn|
fixture(:x86_64, fn)
end

groups.each do |filename, actual|
file = MachO::MachOFile.new(filename)

Expand All @@ -460,6 +464,7 @@ def test_delete_rpath
# ensure we can actually re-load and parse the modified file
modified = MachO::MachOFile.new(actual)

assert_empty modified.rpaths
assert_equal file.serialize.bytesize, modified.serialize.bytesize
assert_operator modified.ncmds, :<, orig_ncmds
assert_operator modified.sizeofcmds, :<, orig_sizeofcmds
Expand Down

0 comments on commit f73089c

Please sign in to comment.