Add malloc_spec and fix int_assignments_spec

GSoC/Meterpreter_Web_Console
Wei Chen 2018-06-28 21:03:27 -05:00
parent e733e3b62c
commit 03c3e08167
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
require 'metasploit/framework/obfuscation/crandomizer/code_factory'
RSpec.describe Metasploit::Framework::Obfuscation::CRandomizer::CodeFactory::Malloc do
subject(:int_assignments) do
described_class.new
end
describe '#stub' do
it 'is a string' do
expect(subject.send(:stub).class).to be(String)
end
it 'has a malloc' do
expect(subject.send(:stub)).to match(/malloc\(\d+\)/)
end
it 'has a stub() function' do
expect(subject.send(:stub)).to match(/void stub()/)
end
it 'depends on stdlib.h' do
expect(subject.dep).to eq(['stdlib.h'])
end
end
end