Skip to content

Commit

Permalink
Try setting different header for FreeBSD.
Browse files Browse the repository at this point in the history
  • Loading branch information
djberg96 committed Jul 31, 2024
1 parent 7d00615 commit 2e80d28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/sys_proctable_bsd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@
context 'C struct verification' do
let(:dummy){ Class.new{ extend Mkmf::Lite } }

before do
@header = RbConfig::CONFIG['host_os'] =~ /dragonfly/i ? 'sys/kinfo.h' : 'kvm.h'
end

it 'has a timeval struct of the expected size' do
expect(Sys::ProcTableStructs::Timeval.size).to eq(dummy.check_sizeof('struct timeval', 'sys/time.h'))
end
Expand All @@ -242,7 +246,7 @@
end

it 'has an kinfo_proc struct of the expected size' do
expect(Sys::ProcTableStructs::KInfoProc.size).to eq(dummy.check_sizeof('struct kinfo_proc', 'sys/kinfo.h'))
expect(Sys::ProcTableStructs::KInfoProc.size).to eq(dummy.check_sizeof('struct kinfo_proc', @header))
end
end
end

0 comments on commit 2e80d28

Please sign in to comment.