Skip to content

Commit 29628d8

Browse files
committed
Tweak #delete_rpath test
1 parent 25a6ee5 commit 29628d8

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

test/test_macho.rb

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -451,14 +451,19 @@ def test_delete_rpath
451451
file = MachO::MachOFile.new(filename)
452452

453453
refute_empty file.rpaths
454-
orig_ncmds = file.ncmds
454+
orig_ncmds = current_ncmds = file.ncmds
455455
orig_sizeofcmds = file.sizeofcmds
456-
orig_npaths = file.rpaths.size
456+
orig_npaths = current_npaths = file.rpaths.size
457457

458-
file.rpaths.each { |rpath| file.delete_rpath(rpath) }
459-
assert_operator file.ncmds, :<, orig_ncmds
460-
assert_operator file.sizeofcmds, :<, orig_sizeofcmds
461-
assert_operator file.rpaths.size, :<, orig_npaths
458+
file.rpaths.each do |rpath|
459+
file.delete_rpath(rpath)
460+
current_npaths -= 1
461+
current_ncmds -= 1
462+
463+
assert_equal file.ncmds, current_ncmds
464+
assert_equal file.rpaths.size, current_npaths
465+
assert_operator file.sizeofcmds, :<, orig_sizeofcmds
466+
end
462467

463468
file.write(actual)
464469
# ensure we can actually re-load and parse the modified file

0 commit comments

Comments
 (0)